Concept Flow - Check if Stack is Empty or Full
Start
Check if stack pointer == -1?
Yes→Stack is Empty
|No
Check if stack pointer == max size - 1?
Yes→Stack is Full
|No
Stack has space and elements
End
We first check if the stack pointer is -1 to see if the stack is empty. If not empty, we check if the pointer reached max size - 1 to see if it is full.
