Question: Write a demo program which can use your Stack class to store characters in LIFO order. Perform the following operations in this exact order.
Write a demo program which can use your Stack class to store characters in LIFO order. Perform the following operations in this exact order. After each operation, print the stack and its top_of_stack and Size() values using the method you created. If your program is unable to perform an operation, print the error to the console. 1. Create the stack with MAX_SIZE of 5. 2. Push C 3. Push S 4. Push- 5. Push 2 6. Push 2 7. Push 1 8. Pop 9. Pop 10. Pop 11. Push 2 12. Push 2 13. Push 1 14. Pop 15. Push 3 16. Pop 17. Pop 18. Pop 19. Pop 20. Pop 21. Pop
Step by Step Solution
There are 3 Steps involved in it
The Below is a simple Python program that demonstrates the described operations using a Stack class Make sure you have the Stack class implemented bef... View full answer
Get step-by-step solutions from verified subject matter experts
