Concept Flow - Dynamic Stack Using Resizable Array
Start
Push Operation
Check if array is full?
No→Add element at top
Yes
Double array size
Copy old elements to new array
Add element at top
Update top pointer
Done
Pop Operation
Check if stack empty?
Yes→Error: Underflow
No
Remove element at top
Update top pointer
Check if array too empty?
Yes
Halve array size
Copy elements to smaller array
Done
This flow shows how the stack uses an array that grows or shrinks dynamically when pushing or popping elements.
