<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Urgent! Need help finding algorithm' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Urgent! Need help finding algorithm' posted on the 'Algorithms' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 08:29:02 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 08:29:02 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Urgent! Need help finding algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/116064/116064/urgent-need-help-finding-algorithm/</link>
      <description>I have an assignment about finding the algorithm of carcinoid phrases like "Anna" or something like "Pollop", words that can be spelled the same backwards. I have created one of my one but it is too scratchy for my proffesor. If anyone can help sending an URL please do, i need it yesterday! &lt;br /&gt;
I also need additional information about these phrases. I have been over 6 hours on search engines and i have found nothing. I need help finding resources so if anyone can help i would appreciate it very much :))&lt;br /&gt;
Thank you&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/116064/116064/urgent-need-help-finding-algorithm/</guid>
      <pubDate>Tue, 14 May 2002 02:18:00 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Re: Urgent! Need help finding algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/116064/116087/re-urgent-need-help-finding-algorithm/#116087</link>
      <description>The words you are referring to are called palindroms. I assume you are trying to determine if a given string is a palindrom. To do this, you create a string that is the reverse of the other, set the case on both of them to be the same, and use string.equal(string) to see if they are the same. To reverse the string, simply loop through the string one character at a time and place it at the beginning of a temporary string, such as:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
while (i &amp;lt; str1.length())
    str2 = str1.charAt(i) + str2;
str1 = str1.toLowerCase();
str2 = str2.toLowerCase();
return str1.equals(str2);
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I wrote this code using Java, which has these methods at my disposal. If you don't have these methods, then you would have to parse the original string one character at a time, and then store the character at the beginning of one string and at the end of another:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
while (myStr != null)
{   Char c = myStr.substring(0,1);
    myStr = myStr.subString(1);
    str1 = str1 + c;
    str2 = c + str2;
}
while (str1 != null)
{   Char c1 = str1.substring(0,1);
    Char c2 = str2.substring(0,1);
    str1 = str1.substring(1);
    str2 = str2.substring(1);
    if (c1 != c2)
    {   retValue = false;
        str1 = null;
    }
}
return retValue;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I can't think of any other way to do this right now, but if one comes to me, I'll let you know.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have enough memory, you won't have enough disk space.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/116064/116087/re-urgent-need-help-finding-algorithm/#116087</guid>
      <pubDate>Tue, 14 May 2002 07:44:12 -0700</pubDate>
      <category>Algorithms</category>
    </item>
    <item>
      <title>Re: Urgent! Need help finding algorithm</title>
      <link>http://www.programmersheaven.com/mb/Algorithms/116064/124233/re-urgent-need-help-finding-algorithm/#124233</link>
      <description>There is a website that has weekly programming competitions that was mentioned elsewhere that has an algo for finding palindromes.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.geocities.com/acmesofties/"&gt;http://www.geocities.com/acmesofties/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
All code in C&lt;br /&gt;
&lt;br /&gt;
The week 1 answer was&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
int ispalin(char *a,int st,int end)
{
 return (st&amp;gt;=end)?1:(a[st]==a[end])?ispalin(a,st+1,end-1):0;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
But you could also try this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
int IsPalin(char *s)
{
  int i, j = 0;
  for(i = 0; s[i]; i++) ;
  while(s[--i] == s[j] &amp;amp;&amp;amp; i &amp;gt; ++j) ;
  return j &amp;gt;= i;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/Algorithms/116064/124233/re-urgent-need-help-finding-algorithm/#124233</guid>
      <pubDate>Fri, 28 Jun 2002 12:33:24 -0700</pubDate>
      <category>Algorithms</category>
    </item>
  </channel>
</rss>