Stacks
← Back to Linear Structures
Last-In-First-Out (LIFO) collection. Elements are pushed onto and popped from the top. Can be implemented with arrays or linked lists.
Key Properties
Complexity
| Operation | Time Complexity |
|---|---|
| Push | O(1) |
| Pop | O(1) |
| Peek | O(1) |
Related
- Queues (contrast — FIFO)
- Arrays or Linked Lists (implementation)