Be the first user to complete this post

  • 0
Add to List
Beginner

290. Reverse a String using Recursion

Objective: Given a String, write a recursive program to reverse it.

Example:

Original String: tutorial horizon
Reversed String: noziroh lairotut

Approach:

  • Take the first character out of the string, add it to the end of result of the remaining string.
  • Make a recursive call to remaining string.

Output:

Original String: tutorial horizon
Reversed String: noziroh lairotut