STACK - a pile of elements :
Print this page
 
Introduction:
  1. Stack is basically a data object
  2. 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:
    1. PUSH : add an element at the top of the list.
    2. POP    : remove the at the top of the list.
    3. Also "IsEmpty()" and IsFull" function, which tests whether a stack is empty or full respectively.

Example :

  1. Practical daily life :    a pile of heavy books kept in a vertical box,dishes kept one on top of another
  2. 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
Prev