Question: Homework # 3 Given a string, reverse it using a stack. For example, the string Bloc! should be converted to ! colB. Reference answer:

Homework #3
Given a string, reverse it using a stack. For
example, the string "Bloc!" should be converted
to "!colB".
Reference answer:
char* Reverse(char* original){
PSeqStack stack;
char reverse[MAXNUM];
Create an empty stack and assign the start address to stack;
Traverse the character array original in forword direction and push all
the variables onto stack;
Keep poping the top element off stack and write it in the array reverse
until stack is empty;
return reverse;
}
Please provide code in C++
Homework # 3 Given a string, reverse it using a

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 Programming Questions!