Question: 3. (10 pts) Complete the function definition for is Palindrome. It takes a string as a parameter and returns 0 if the string is
3. (10 pts) Complete the function definition for is Palindrome. It takes a string as a parameter and returns 0 if the string is NOT a palindrome and returns 1 if the string is a palindrome. The function MUST use a stack to complete this task. int isPalindrome (char *str) { if (str = NULL) { } return 0; Stack s = initStack(); int i = 0; // push each character of str to the stack while (str[i] != '\0') { // complete loop body (4 pts). } // now pop stack, checking that the value on top of the stack equals the str char i = 0; while (str[i] != '\0') { // complete loop body (6 pts) } return 1; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
