🧠

Stack

Stack

  • Abstract data type
  • Collection of elements
  • Access only available from one end (the top)
  • Last In First Out (LIFO)
  • Imagine items stacked on top of each other

Operations

  • Push
    • Add element to the top of the collection
  • Pop
    • Remove the most recently added element
  • Peek
    • View to of stack without removing element

Computer Science Data Structure