Question: Homework # 3 Given a string, reverse it using a stack. For example, the string Bloc! should be converted to ! colB. Reference answer:
Homework #
Given a string, reverse it using a stack. For
example, the string "Bloc!" should be converted
to colB".
Reference answer:
char Reversechar original
PSeqStack stack;
char reverseMAXNUM;
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
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
