<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments for akalin.cx</title>
	<link>http://www.akalin.cx</link>
	<description>Musings on math, music, and computer science</description>
	<pubDate>Fri, 10 Sep 2010 05:13:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>Comment on Finding the longest palindromic substring in linear time by greme</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-95585</link>
		<dc:creator>greme</dc:creator>
		<pubDate>Sun, 18 Jul 2010 01:59:57 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-95585</guid>
		<description>hi,

great article. 

i however has some doubts why this is a O(n), let's take the example aaaaaaaaa, in this case, it is obvious that each a will have to be expended, according to the above algorithm, therefore it would be O(n^2). 

where did mess up?

thanks,</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>great article. </p>
<p>i however has some doubts why this is a O(n), let&#8217;s take the example aaaaaaaaa, in this case, it is obvious that each a will have to be expended, according to the above algorithm, therefore it would be O(n^2). </p>
<p>where did mess up?</p>
<p>thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding the longest palindromic substring in linear time by Jayant Jape</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-95143</link>
		<dc:creator>Jayant Jape</dc:creator>
		<pubDate>Tue, 22 Jun 2010 09:57:11 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-95143</guid>
		<description>I used your logic and trid to convert it to not to use array to save some space below is my version pl comment


        public static string GetLongestPelindrome()
        {

            string str = "dcfcdhihijkjihjfccccccccccabcdefggfedcba";
            int[] index = new int[str.Length];
            int[] length = new int[str.Length]; 
            char c;
            int currentindex = 0, i = 0, j = 0, bMaxindex = 0, bMaxLength = 0, sMaxindex = 0, sMaxLength = 0;

            if (str[0] == str[1])
            {
                currentindex = 0;
                bMaxLength = 2;
            }
            else 
            {
                currentindex = 1;
                bMaxLength = 1;
            }

            for (i = 0; i &#60; str.Length; i = j)
            {
                c = str[i];
                for (j = i + 1; j &#60; str.Length &#38;&#38; str[j] == c; j++) ;
                if (sMaxLength &#60; j - i)
                {
                    sMaxLength = j - i;
                    sMaxindex  = i;
                }
            }

            for (i = 2; i &#60; str.Length; i++)
            {
                if (i == 16) i = i;
                if (currentindex == (i - 1))
                {
                    if (str[i] == str[i - 2])
                    {
                        bMaxLength = 3;
                        bMaxindex = i - 2;
                        currentindex = i - 2;
                    }
                    else if (str[i] == str[i-1])
                    {
                        bMaxLength = 2;
                        bMaxindex = i - 2;
                        currentindex = i - 1;
                    }
                    else
                    {
                        currentindex = i;
                        bMaxLength = 1;
                        bMaxindex = i;
                    }
                }
                else
                {
                    if (currentindex - 1  sMaxLength)
                {
                    sMaxLength = bMaxLength;
                    sMaxindex = bMaxindex; 
                }

            }


            return (str.Substring(sMaxindex, sMaxLength)); 
        
        }</description>
		<content:encoded><![CDATA[<p>I used your logic and trid to convert it to not to use array to save some space below is my version pl comment</p>
<p>        public static string GetLongestPelindrome()<br />
        {</p>
<p>            string str = &#8220;dcfcdhihijkjihjfccccccccccabcdefggfedcba&#8221;;<br />
            int[] index = new int[str.Length];<br />
            int[] length = new int[str.Length];<br />
            char c;<br />
            int currentindex = 0, i = 0, j = 0, bMaxindex = 0, bMaxLength = 0, sMaxindex = 0, sMaxLength = 0;</p>
<p>            if (str[0] == str[1])<br />
            {<br />
                currentindex = 0;<br />
                bMaxLength = 2;<br />
            }<br />
            else<br />
            {<br />
                currentindex = 1;<br />
                bMaxLength = 1;<br />
            }</p>
<p>            for (i = 0; i &lt; str.Length; i = j)<br />
            {<br />
                c = str[i];<br />
                for (j = i + 1; j &lt; str.Length &amp;&amp; str[j] == c; j++) ;<br />
                if (sMaxLength &lt; j - i)<br />
                {<br />
                    sMaxLength = j - i;<br />
                    sMaxindex  = i;<br />
                }<br />
            }</p>
<p>            for (i = 2; i &lt; str.Length; i++)<br />
            {<br />
                if (i == 16) i = i;<br />
                if (currentindex == (i - 1))<br />
                {<br />
                    if (str[i] == str[i - 2])<br />
                    {<br />
                        bMaxLength = 3;<br />
                        bMaxindex = i - 2;<br />
                        currentindex = i - 2;<br />
                    }<br />
                    else if (str[i] == str[i-1])<br />
                    {<br />
                        bMaxLength = 2;<br />
                        bMaxindex = i - 2;<br />
                        currentindex = i - 1;<br />
                    }<br />
                    else<br />
                    {<br />
                        currentindex = i;<br />
                        bMaxLength = 1;<br />
                        bMaxindex = i;<br />
                    }<br />
                }<br />
                else<br />
                {<br />
                    if (currentindex - 1  sMaxLength)<br />
                {<br />
                    sMaxLength = bMaxLength;<br />
                    sMaxindex = bMaxindex;<br />
                }</p>
<p>            }</p>
<p>            return (str.Substring(sMaxindex, sMaxLength)); </p>
<p>        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding the longest palindromic substring in linear time by Anand</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-95126</link>
		<dc:creator>Anand</dc:creator>
		<pubDate>Sun, 20 Jun 2010 15:49:47 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-95126</guid>
		<description>Can you guys please share the code for vec also. like vec.add and vec.size</description>
		<content:encoded><![CDATA[<p>Can you guys please share the code for vec also. like vec.add and vec.size</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding the longest palindromic substring in linear time by zobayer</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-94171</link>
		<dc:creator>zobayer</dc:creator>
		<pubDate>Sat, 24 Apr 2010 12:02:49 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-94171</guid>
		<description>wow... amazing algorithm!!!</description>
		<content:encoded><![CDATA[<p>wow&#8230; amazing algorithm!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding the longest palindromic substring in linear time by Abhishek</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-93768</link>
		<dc:creator>Abhishek</dc:creator>
		<pubDate>Wed, 24 Mar 2010 16:16:44 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-93768</guid>
		<description>Can you please explain or run your algorithm for a string which is not palindrome as a whole but a substring of this string is a palindrome. For example aabbbb (answer would be bbbb in this case).

Actually I am not able to understand the lengths array formation correctly or the array represents the list of longest palindrome lengths by center.

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Can you please explain or run your algorithm for a string which is not palindrome as a whole but a substring of this string is a palindrome. For example aabbbb (answer would be bbbb in this case).</p>
<p>Actually I am not able to understand the lengths array formation correctly or the array represents the list of longest palindrome lengths by center.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on I love Half-Price Books! by Cindy</title>
		<link>http://www.akalin.cx/2005/11/26/i-love-half-price-books/#comment-93745</link>
		<dc:creator>Cindy</dc:creator>
		<pubDate>Tue, 23 Mar 2010 03:26:04 +0000</pubDate>
		<guid>http://www.akalin.cx/2005/11/26/i-love-half-price-books/#comment-93745</guid>
		<description>You are too right. I was googling half price and stumbled upon this note. And it suffices to say I have never read a heading more enticing in a physics book..or any kind of textbook for that matter.</description>
		<content:encoded><![CDATA[<p>You are too right. I was googling half price and stumbled upon this note. And it suffices to say I have never read a heading more enticing in a physics book..or any kind of textbook for that matter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding the longest palindromic substring in linear time by tombstone</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-93074</link>
		<dc:creator>tombstone</dc:creator>
		<pubDate>Thu, 25 Feb 2010 05:51:11 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-93074</guid>
		<description>good work. awesome</description>
		<content:encoded><![CDATA[<p>good work. awesome</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding the longest palindromic substring in linear time by Mohan Kumar</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-92769</link>
		<dc:creator>Mohan Kumar</dc:creator>
		<pubDate>Wed, 10 Feb 2010 07:07:26 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-92769</guid>
		<description>Could anybody explain the logic behind this....?</description>
		<content:encoded><![CDATA[<p>Could anybody explain the logic behind this&#8230;.?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding the longest palindromic substring in linear time by Mike</title>
		<link>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-92358</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 28 Jan 2010 23:59:56 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/11/28/finding-the-longest-palindromic-substring-in-linear-time/#comment-92358</guid>
		<description>Unless I'm missing something, I don't see how the running time is O(n).

Take for example the following input, "aaaaaaaaaa".  The algorithm above will expand the center on every iteration.</description>
		<content:encoded><![CDATA[<p>Unless I&#8217;m missing something, I don&#8217;t see how the running time is O(n).</p>
<p>Take for example the following input, &#8220;aaaaaaaaaa&#8221;.  The algorithm above will expand the center on every iteration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A foray into number theory with Haskell by Tamko</title>
		<link>http://www.akalin.cx/2007/07/06/a-foray-into-number-theory-with-haskell/#comment-90933</link>
		<dc:creator>Tamko</dc:creator>
		<pubDate>Wed, 11 Nov 2009 09:26:59 +0000</pubDate>
		<guid>http://www.akalin.cx/2007/07/06/a-foray-into-number-theory-with-haskell/#comment-90933</guid>
		<description>I don't understand. Beside, your topic is LAME!</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand. Beside, your topic is LAME!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
