Linear Data Structures
Arrays, dynamic arrays, strings, hash maps, hash collisions, stacks, queues, deques, matrix manipulation. The vocabulary every interview problem assumes you have.
- Chapters
- 8
- Hours
- 2
- Difficulty
- Beginner
- 1.0beginner
Arrays: static, dynamic, multi-dimensional
Arrays: contiguous memory, O(1) indexing, and the operations that differ between fixed-size arrays and dynamic arrays.
- 1.1intermediate
Dynamic array internals
How dynamic arrays grow: amortised O(1) append, the doubling trick, capacity vs length, and what each language calls them.
- 1.2beginner
Strings: encoding, immutability, builders
Strings as character arrays and beyond: immutability, encoding, concatenation cost, and the per-language trade-offs that catch interviews out.
- 1.3intermediate
Hash maps and hash sets
Hash maps from first principles: hash functions, buckets, average vs worst-case complexity, and the standard library implementations.
- 1.4advanced
Hash collisions and the load factor
Hash collisions: separate chaining, open addressing, load factor, rehashing, and why hash maps degrade to O(n) under adversarial keys.
- 1.5beginner
Stacks and the call stack analogy
Stacks as data structures and algorithmic primitives: LIFO, function-call stacks, and the interview problems that scream 'stack'.
- 1.6intermediate
Queues, deques, and circular buffers
Queues and deques: FIFO, double-ended, ring buffers, and the BFS / sliding-window problems where the right primitive is a deque.
- 1.7intermediate
Matrix manipulation
2D arrays and matrix manipulation: in-place rotation, transposition, spiral traversal, and indexing without off-by-one bugs.