Introduction to Stack | Push | Pop
  1. A stack is a container of items that are inserted and removed according to the principle of last-in first-out.
  2. It is named stack as it behaves like a real-world stack, for example – a pile of plates.
  3. In the pushdown stacks only two operations are allowed: push the item into the stack, and pop the item out of the stack.
  4. push adds an item to the top of the stack, pop removes the item from the top.
  5. Stack follow the LIFO data structure. LIFO stands for Last-in-first-out. Here, the element which is placed (inserted or added) last, is accessed first. In stack terminology, insertion operation is called PUSH operation and removal operation is called POP operation.