Palindrome detection: Difference between revisions
Content deleted Content added
No edit summary |
m →{{header|Haskell}}: Added a comment to a version better suited to indexed arrays than to linked lists. |
||
Line 2,600:
'''Recursive'''
See the C palindrome_r code for an explanation of the concept used in this solution
though it may be better suited to indexed arrays than to linked lists.
(last is expensive, and entails multiplied recursions over the right hand side
of the remaining list here).
<lang haskell>is_palindrome_r x | length x <= 1 = True
|