Professional Documents
Culture Documents
Stack 111104232459 Phpapp02
Stack 111104232459 Phpapp02
Stack 111104232459 Phpapp02
A
Data Structure
Table of Contents
What is a Stack
Stack Operations
LIFO Stack
Applications of stack
Checking for balanced braces
Converting Infix Expression to Postfix
Postfix calculator
What is a Stack?
A
Stack Operations
PUSH
Adds the object to the top of the stack
POP
Removes the object at the top of the stack
and returns it
PEEK
Returns the top object of the stack but does
not remove it from the stack
ISEMPTY
A LIFO Stack
Push
Stack Pointer
Pop
Top
Bottom
Push Operation
Pop Operation
Stack pointer
J=2
Before Push
Pop
A[n]
Stack pointer
J=3
After Push
After many
Push Ops
Stack Pointer
J=2
After Pop
Stack Pointer
J=3
Before Pop
Stack pointer
J=n
Stack Full
Infix Expression
a+b
Postfix Expression
ab+
A postfix calculator
Pushes
stack
Acknowledgement
-By