Data Structures and Algorithms ยท Linear structures
Stacks and queues
Two restricted-access orderings, last-in-first-out and first-in-first-out.
Also known as: LIFO, FIFO, push pop, enqueue dequeue.
Start a lesson on Stacks and queuesLearn first
- Linked lists: Nodes scattered in memory, each pointing to the next, trading fast indexing for cheap insertion.
Leads to
Related topics
- Graph traversal (BFS and DFS): Visiting every reachable vertex, either level by level (BFS) or by diving deep first (DFS).
- Backtracking: Trying a choice, recursing, and undoing it if it leads nowhere, to explore all possibilities.