Array List
Contiguous storage with O(1) indexing — append, insert, delete, and the shift cost.
Curriculum
Sorting, search, dynamic programming, graph algorithms, classic problems
Array List
Contiguous storage with O(1) indexing — append, insert, delete, and the shift cost.
Stack
LIFO — push, pop, peek operations
Monotonic Stack
Keep stack values ordered and pop smaller candidates to find each element's next greater value.
Queue
FIFO — enqueue, dequeue operations
Linked Lists
Singly list — node, head, next pointer
Doubly Linked List
prev + next — O(1) delete, both ways
Circular Linked List
tail.next = head — a ring, no null end
Hash Table — Separate Chaining
Each bucket holds a linked chain of colliding keys
Hash Table — Linear Probing
Open addressing: probe forward on collision, tombstones for delete
Tree Basics
Root, child, height, and the three traversal orders — the vocabulary of trees.
Binary Search Tree
Ordered tree — insert, search, delete with successor swap
AVL Tree
A BST that rotates whenever an insert leaves a node unbalanced, keeping its height logarithmic.
Red-Black Tree
Balance kept by recoloring and rotation — the tree behind most standard libraries.
Heaps
Min-heap, max-heap, priority queues
Trie
Prefix tree for fast string lookup
Union-Find
Disjoint sets with path compression
Graph Representation
Adjacency list vs matrix, edges, and degree — how a graph becomes data.
Bubble Sort
Simple comparison-based sorting
Selection Sort
Find minimum, swap to front
Insertion Sort
Build sorted prefix one element at a time
Merge Sort
Stable sort with O(n log n)
Quick Sort
Divide & conquer, pivot selection
Heap Sort
In-place using binary heap
Counting Sort
Prefix sums turn counts into addresses
Radix Sort
Stable buckets, zero comparisons
Linear Search
Scan front to back until you find it — the baseline, and the worst case.
Binary Search
Logarithmic search on sorted data
Two Pointers
Two indices walking a sorted array inward — pair sums and shrinking ranges.
Sliding Window
Grow and shrink a window over a sequence to answer subarray questions in O(n).
Depth-First Search
Graph traversal using stack
Breadth-First Search
Graph traversal using queue
Tree Traversal
Preorder, inorder, and postorder — the same tree, three visiting orders.
Connected Components
Label each island of a graph by sweeping unvisited nodes with DFS/BFS.
A* Pathfinding
Heuristic-based shortest path
KMP String Matching
Reuse prefix-suffix borders after a mismatch to match in O(n + m) without rescanning the text.
Rabin-Karp
Find a pattern with a rolling hash, comparing fingerprints before characters.
Suffix Array
Every suffix sorted into an array — fast substring queries over one text.
N-Queens
Place N queens with no two attacking — backtrack the moment a column dies.
Permutations
Build every ordering by choosing, recursing, and undoing each choice.
Sudoku Solver
Fill the grid cell by cell, backtracking when a digit breaks a constraint.
Fibonacci & Memoization
From naive recursion to bottom-up DP
Coin Change
Greedy vs DP for the fewest coins
Longest Common Subsequence
2D DP table over two strings
Edit Distance
Levenshtein recurrence visualized
0/1 Knapsack
Item selection under capacity constraint
Interval Scheduling
Always pick the earliest finish — the exchange argument shows why it wins
Huffman Coding
Merge the two rarest symbols until one tree encodes them all
Jump Game (LeetCode #55)
One sweep tracking the farthest reachable index
Fractional Knapsack
When items can be split, packing by value density is optimal
Dijkstra
Shortest path with priority queue
Bellman-Ford
Relax every edge V−1 times — handles negative weights, detects negative cycles
Minimum Spanning Tree
Prim & Kruskal compared
Topological Sort
DAG ordering with DFS and Kahn's algorithm
Two Sum (LeetCode #1)
Two indices whose values sum to target — one-pass hash map walkthrough
LRU Cache (LeetCode #146)
O(1) get and put — a hash map and a doubly linked list working as one
Trapping Rain Water (LeetCode #42)
Build both boundary arrays, then collapse them into two running maxima that settle one column per move
3Sum (LeetCode #15)
Sort, fix one number, walk two pointers inward — skipping duplicates