Question: Please write Java program with comments that answer the prompt below. Thank you. Recursion Part : Write a recursive method that displays a string in

Please write Java program with comments that answer the prompt below. Thank you.  Please write Java program with comments that answer the prompt below.

Recursion Part : Write a recursive method that displays a string in revers order on the console using the following header: public static void reverseDisplay String valuel To make sure this program makes efficient use of memory, have the method call a helper method that includes the string's high indexc public static void reverseDisplay String value, int high) Write a program to test your recursive method by prompting the user to enter a string and then displays it in reverse order. This program is the same as Exercise 18.12 of the textbook, page 744. Sample Output: Enter your string: Able was I, I saw Elba (user input appears in bold adjacent the prompt) ablE was I J saw elbA (this is the program output) Part Il: Write a recursive method to print all permutations ofa string. Then a write a program to test the method, by once again, prompting the user to enter a string of characters. For example, the permutations for the string "abc are the following abc bac bca cab cba Hint: Define the following two methods. The second is a helper method. public static void displayPermutation String s public static void displayPermutation String s1, String s2) The first method simply invokes displayPermutation s). The second method uses a loop to move a character from s2 to s1 and recursively invokes it new s1 and s2. The base case is that s2 is empty and prints s1 to the console This program is the same as Exercise 18.25 of the textbook, page 746

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!