Question: Reverse a string [ Difficulty: Medium ] Given a string, reverse it using a stack and print it . Input Format String that has to

Reverse a string
[Difficulty: Medium]
Given a string, reverse it using a stack and print it.
Input Format
String that has to be reversed.
Output Format
The reverse of the input string
Sample Input 1:
abcd
Sample Output 1:
dcba
Sample Input 2:
abcdef
Sample Output 2:
fedcba

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!