Ask your own question, for FREE!
Computer Science 23 Online
OpenStudy (anonymous):

How do you create a recursive function that returns the reverse of an inputted string?

OpenStudy (e.mccormick):

In what language? In geberal, it would print the last character of the string, then pass the string without the last character to itself.

OpenStudy (rsmith6559):

As you recurse you take a character from one end of the string, and as you unwind you concatenate the string in reverse order. The base case would be len( string ) == 0

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!