Prerequisites
Start with these data structures before reading the algorithm chapters. You do not need to master every implementation first; you need to recognize the operations each structure makes cheap.
Data Structures
- Arrays — contiguous storage with constant-time indexed access.
- Linked lists — nodes connected by references, useful when insertion and removal happen at known nodes.
- Stacks, queues, and deques — restricted access patterns for LIFO, FIFO, and double-ended work.
- Hash tables and sets — key-based lookup and membership testing with expected constant-time operations.
- Trees and heaps — hierarchical data, ordered search, and priority-based retrieval.
- Graphs — vertices and edges for relationships, dependencies, and routes.
- Union-Find — a compact structure for tracking connected components as edges are added.
Core skills
- Read and write loops, conditionals, functions, and simple classes.
- Know references, mutation, recursion, and the difference between a value and a reference to a value.
- Estimate time and space growth using input size .
- Trace an algorithm by hand on a small input before optimizing it.