Question: Write a program to create a stack data structure (do not use the built-in stack class) using arrays. It should support Push, Pop, and Peek

Write a program to create a stack data structure (do not use the built-in stack class) using arrays. It should support Push, Pop, and Peek operations. - Create a stack using arrays with an array size of 10. - Push integers 20, 40, 60 into the stack. - Print the items in the stack. - Pop the item from the stack and print the popped item. - Peek the stack and print the top-most element of the stack (do not remove it) - Print the stack. Task 3 Expected Output: Items in the stack: 60,40,20 Popped item is: 60 Peeked item is: 40 Items in the stack: 40,20
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
