Question: Write This program in C++ A palindrome is a phrase that, ignoring punctuation and case, reads the same forwards and backwards. Write 3 boolean functions

Write This program in C++

A palindrome is a phrase that, ignoring punctuation and case, reads the same forwards and backwards.

Write 3 boolean functions that returns true if their string parameter is a palindrome and false if it is not.

The first function, isPalindromeI, is an iterative, non recursive function that use a loop to recognize the palindrome.

The second function, isPalindromeR, is a non-iterative (no loops), recursive function that invokes itself until one of its two stopping conditions is true.

The third function, isPalindromeSQ, is an iterative function that uses two loops, a stack, and a queue to recognize the palindrome. The first loop adds each letter or digit to the top of the stack and the end of the queue. The second loop removes the top of the stack and the front of the queue if they are equal or stops the loop if they are not.

For example, "Pull up, if I pull up!", "Able was I 'ere I saw Elba", "War sir, is raw!" are palindromes.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!