1. If an array contains n elements, what are the maximum number of recursive calls made by the binary search algorithm?
2. A palindrome is a string that reads the same forwards and backward. consider some example
Able was I ere I saw Elbe.
Was it a rat I saw?
Madam! I'm Adam.
Live not on evil, madam live not on evil.
Red rum, sir, is murder!
A man a plan a canal Panama.
Otto.
Design a recursive method with the following signature
public boolean palindrome )String phrase, int left, int right);
that will determine 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 case characters.
Here's our recursive definition for a palindrome:
If the outer two characters match, then the String is a palindrome if the remaining String is a palindrome.