Concept Flow - Dynamic Stack Using Resizable Array
Start
Push Element
Check Capacity Full?
No→Add Element at Top
Yes
Double Array Size
Copy Old Elements
Add Element at Top
Update Top Index
Done
Pop Element
Check Stack Empty?
Yes→Error or Return Null
No
Remove Element at Top
Update Top Index
Check Capacity Too Large?
No→Done
Yes
Halve Array Size
Copy Elements to Smaller Array
Done
The stack adds elements at the top, resizing the array by doubling when full, and removes elements from the top, halving the array size when too empty.
