1.迭代法
bool isPalindrome(const char* s, int low, int high) {
while (low <= high) {
if (s[low++] != s[high--])
return false;
}
return true;
}
2.迭代法
//要求用递归方法实现该函数
bool isPalindrome(const char* s, int low, int high) {
//......
if (low >= high)return true;
if (s[low] == s[high])
isPalindrome(s, low + 1, high - 1);
else
return false;
}//内存超了