0
2.0kviews
Write ADT for stack. Give application of stack
1 Answer
0
135views
  1. Stack is an LIFO structure.
  2. It is represented using an array
  3. Variable “Top” is used to track the topmost element of stack.
  4. Stack is represented as follows

        struct stack
        {
           int data[SIZE];
           int top;
        }s;
    
  5. Where variable SIZE is used to specify the length of stack and its declared as constant

  6. “s” is variable of type stack consisting of
    1. array “data[SIZE]” and
    2. integer variable “top”.
  7. Following are the applications of stack
    1. Recursion
    2. Polish notation conversion
    3. Expression evaluation
    4. Reversal of List
Please log in to add an answer.