Question: Do not use any loops. You must use recursion Do not use any auxiliary data structures like StringBuilder, StringBuffer, array, list, map, set, stack, queue,
Do not use any loops. You must use recursion
Do not use any auxiliary data structures like StringBuilder, StringBuffer, array, list, map, set, stack, queue, etc
You can use helper if you want.
s, the String methods include length, isEmpty, charAt, substring.
ASAP!
Recursion: Write a recursive method unscramble (String s) that unscrambles strings. It goes through the input string s alternating placing letters at the front and back of the return string. Some example outputs are shown below. unscramble ("byultftre") "butterfly" 489 unscramble("") unscramble ("tyin") "tiny" unscramble ("t") unscramble ("dsaetrau tsctur") "data structures" If we take a closer look at the first input byultftre. We see that in the output string butterfly", the 'b' is placed at the front of the result string, then the 'y' is placed at the end, then the 'u' is tacked onto the string at the front which becomes bu", then the 'l is tacked onto the string at the end which becomes "ly" and so on and so forth
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
