Question
DCP5301 Data Structure and Algorithms Submission question Write a program to perform operation push and pop on a linked stack. The program will prompt the
DCP5301 Data Structure and Algorithms Submission question Write a program to perform operation push and pop on a linked stack. The program will prompt the user for input and will display the operation result accordingly:
1: Push - program prompt user input for number to be pushed into the linked stack.
2: Pop - program will remove one element from the linked stack.
3 : Exit - program will display all the element in the linked stack and exit the system. (Modify the full program in Chapter 5 on linked stack.) Sample output :
1 : Push
2 : Pop
3 : Exit Choose operation to perform
: 2 stack is enpty Choose operation to perform :
1 Enter a nunber to push : 40 Choose operation to perform :
1 Enter a nunber to push : 60 Choose operation to perform :
1 Enter a nunber to push : 70 Choose operation to perform
: 2 Number popped: 20 Choose operation to perform
: 3 Data in the stack : 60 40 Thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started