Stack

Meaning

A collection of elements with two principal operations: push (add an element) and pop (remove an element).

Usage Examples

  • Stacks follow the Last In, First Out (LIFO) principle.
  • The call stack is used to manage function calls in programming.
  • Stack overflow errors occur when too much memory is used on the call stack.
  • Stacks are used in algorithms like depth-first search.