Recursive method for palindrome checkup
问题 Is it even possible to define a recursive method for palindrome checkup with the following argument list? int testPalindromeRecursive(char* str, int len) { ... } Note: no external sub-functions or global variables have to be used I think this is impossible, because you have to remember the last (front) index position somehow. 回答1: Yes, it is completely possible - as several people have mentioned. Base Cases: If len <= 1, return True If str[0] != str[len-1] return False Else: recurse with (str