Stack (ADT) Simulator
Push, pop and peek against a fixed capacity, with overflow and underflow shown explicitly.
·
0·
1·
2·
3·
4·
5Empty stack with room for 6. top = -1 means nothing is stored.
step 1 of 4
touched this stepholds a valuefree slot
Operations
Changing capacity clears the structure.
State
- size
- 0 / 6
- top
- -1
- operations
- 3 / 60
Push and pop both act on `top`. Overflow happens when top reaches capacity - 1; underflow when top is -1.
← → to step, or use the buttons above.