Question: (Java) A palindrome is a string that reads the same forwards and backwards. Design a recursive method with the following signature: public boolean palindrome(String phrase,
(Java)
A palindrome is a string that reads the same forwards and backwards.
Design a recursive method with the following signature:
public boolean palindrome(String phrase, int left, int right);
that will determin whether or not a given String, phrase, is a palindrome. Note that left and right contain the index of the first and last String character, respectively. You may assume that all spaces and punctuation have been removed from the String and that the String contains all lower cased characters. Here's our recursive definition for a palindrome:
If the outer two characters match, then the String is a palindrome if the remeaining String is a palindrome.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
