|
- Stack is basically a data object
- The operational semantic (meaning) of stack is LIFO i.e. last in first out
Definition : It is an ordered list of elements n , such that n>0 in which all insertions and deletions are made at one end called the top.
Primary operations defined on a stack:
- PUSH : add an element at the top of the list.
- POP : remove the at the top of the list.
- Also "IsEmpty()" and IsFull" function, which tests whether a stack is empty or full respectively.
Example :
- Practical daily life : a pile of heavy books kept in a vertical box,dishes kept one on top of another
- In computer world : In processing of subroutine calls and returns ; there is an explicit use of stack of return addresses.
Also in evaluation of arithmetic expressions , stack is used.
Large number of stacks can be expressed using a single one dimensional stack only. Such an array is called a multiple stack array.
Test Your Skills : Prob . 1 Prob . 2
|
|