Fill in the code to complete the following function for checking whether a string is a palindrome.
```
bool isPalindrome(const char * const s)
{
if (strlen(s) <= 1) // Base case
return true;
else if _____________________________ // Base case
return false;
else
return isPalindrome(substring(s, 1, strlen(s) - 2));
}
```
bool isPalindrome(const char * const s)
{
if (strlen(s) <= 1) // Base case
return true;
else if _____________________________ // Base case
return false;
else
return isPalindrome(substring(s, 1, strlen(s) - 2));
}
A. (s[0] <> s[strlen(s) - 1])
B. (s[0] = s[strlen(s) - 1])
C. (s[0] == s[strlen(s) - 1])
D. (s[0] != s[strlen(s) - 1])
D. (s[0] != s[strlen(s) - 1])
You might also like to view...
After a table has been named, that name can be used in functions instead of cell references
Indicate whether the statement is true or false
Celeron and Pentium are names of specific processor designs
Indicate whether the statement is true or false