S.top == S.top + 1
S[S.top] = x
if IsEmpty(S)
error "underflow"
else S.top = S.top - 1
return S[S.top + 1]
if S.top == 0
return True
else return False
if IsEmpty(S)
error "underflow"
else return S[top]
- Underflow: An attempt was made to pop an empty stack.
- Overflow: An attempt was made to push an item onto a full stack.
- Time:
- Access:
- Worst Case:
- Average Case:
- Search:
- Worst Case:
- Average Case:
- Insertion:
- Worst Case:
- Average Case:
- Deletion:
- Worst Case:
- Average Case:
- Space:
- Worst Case:
- Parantheses Matching
- Infix to postfix expressions
- Infix expression computation
- Backtracking
- Activation records