- A stack is a container of items that are inserted and removed according to the principle of last-in first-out.
- It is named stack as it behaves like a real-world stack, for example – a pile of plates.
- In the pushdown stacks only two operations are allowed: push the item into the stack, and pop the item out of the stack.
- push adds an item to the top of the stack, pop removes the item from the top.
- 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.