Question: in java (a) Write a recursive function string reverse(string s) which uses the following recursive strategy: reverse all but the first character of the string,
in java
(a) Write a recursive function string reverse(string s) which uses the following recursive strategy: reverse all but the first character of the string, and then concatenate the first character onto it appropriately. Recall that you can add a string and character together using the + operator.
(b) Rewrite this function using this alternative strategy: divide the string in half, reverse each half and the concatenate them appropriately.
(c) Rewrite the recursive binary search routine as a non-recursive method.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
