What is a stack?
“A stack is an ordered
collection of items into which new items may be inserted and
from which item may be deleted at only one end, called TOP of the Stack ”
- Stack is a LIFO(Last In First Out)
- Stack is a linear structure
- Stack is a ordered list of elements of the same type.
Operations of stack:
- PUSH (when an item is inserted to stack)
- PUSH(s, i); adds the item I to the top of the stack
- POP (when an item is removed from stack)
- POP(s); Removes the top element and returns it as a function value
- Array
- Linked List
Applications of stack
- Parsing
- Recursive Function
- Calling Function
- Expression Evaluation
- Expression Conversion
- Infix to postfix
- Infix to prefix
- Postfix to infix
- Prefix to infix
- Towers of Hanoi
To Download click Here
0 comments:
Post a Comment