Consider a situation where you need to write a recursive function void reverse t
ID: 3578237 • Letter: C
Question
Consider a situation where you need to write a recursive function void reverse that reverse a sting. Suppose your recursive solution removes the first character, reverses the string consisting of the remaining text, and combines the two. Which of the following would be a technique that may produce an easier solution? Introduce a helper function that perform using concatenation. Introduce a helper function that reverses a substring of the original string. Write an iterative function that traverse each character in the string. Introduce a helper function that removes the first character of a string.Explanation / Answer
Correct answer is option B.
i.e. Introduce a helper function that reverses a substring of the original string.