# Stack Basics

  • Stack is a data structure which follows LIFO i.e. Last-In-First-Out method.

  • The data/element which is stored last in the stack i.e. the element at top will be accessed first.

  • Insertion and deletion both take place at the top.

  • Operations

    1. push() – Adding element to stack.
    2. pop() – removing element from stack.
    3. top() – to get the element at top.
    4. empty() – to check if the stack is empty or not.
  • Applications

    1. Undo operation in text editors.
    2. Expression evaluation - evaluation of arithmatic expressions.
    3. Expression conversion – Infix , postfix & prefix.
    4. Recursion / Function calls.