title: Palindrome detection efficiency
body: <p>I got curious by <a href="http://dotnet.kapenilattex.com/?p=93" rel="nofollow noreferrer">Jon Limjap's interview mishap</a> and started to look for efficient ways to do palindrome detection. I checked the <a href="https://stackoverflow.com/questions/228518/palindrome-golf">palindrome golf</a> answers and it seems to me that in the answers are two algorithms only, reversing the string and checking from tail and head.</p>
  
  <pre class="lang-py prettyprint-override"><code>def palindrome_short(s):
      length = len(s)
      for i in xrange(0,length/2):
          if s[i] != s[(length-1)-i]: return False
      return True
  
  def palindrome_reverse(s):
      return s == s[::-1]
  </code></pre>
  
  <p>I think neither of these methods are used in the detection of exact palindromes in huge DNA sequences. I looked around a bit and didn't find any free article about what an ultra efficient way for this might be.</p>
  
  <p>A good way might be parallelizing the first version in a divide-and-conquer approach, assigning a pair of char arrays 1..n and length-1-n..length-1 to each thread or processor. </p>
  
  <p>What would be a better way?</p>
  
  <p>Do you know any?</p>