Data structures and algorithms
A university course in data structures and algorithms that picks up where the Software intro lessons stop: cost analysis, heaps, hashing, tries, balanced trees, union-find, graph algorithms, greedy and divide and conquer, dynamic programming, backtracking, string matching and the patterns that solve interview problems. Every lesson is a structure you can step through, a short quiz and usually a small Python exercise.
Measuring cost
How to count the work an algorithm does, beyond a first look at Big O. Start with the Software lesson on Big O and the Maths lessons on logarithms and recurrences, which already cover counting steps and unrolling a recurrence.
-
الدرس 01 · المدة: 12 د
Comparing growth rates: O, Omega and Theta
الخطوات: 8لم يبدأ -
الدرس 02 · المدة: 14 د
Amortised analysis: the accounting and potential methods
الخطوات: 10لم يبدأ -
الدرس 03 · المدة: 12 د
Proving space cost: auxiliary space and recursion depth
الخطوات: 8لم يبدأ -
الدرس 04 · المدة: 14 د
The master theorem
الخطوات: 10لم يبدأ -
الدرس 05 · المدة: 14 د
Expected cost of randomised algorithms
الخطوات: 11لم يبدأ
Linear structures in depth
Linked lists, stacks, queues and deques, built by hand and used to solve real problems. Builds on the Software lessons on arrays and lists and on stacks and queues.
-
الدرس 06 · المدة: 12 د
Linked lists: singly, doubly and circular
الخطوات: 8لم يبدأ -
الدرس 07 · المدة: 12 د
Stacks at work: brackets, undo and expression evaluation
الخطوات: 10لم يبدأ -
الدرس 08 · المدة: 12 د
Ring buffers and deques under the hood
الخطوات: 10لم يبدأ -
الدرس 09 · المدة: 14 د
Monotonic stacks and queues
الخطوات: 11لم يبدأ
Hashing and heaps
What happens inside a hash map when keys collide, and the heap that keeps the smallest item on top. Builds on the Software lesson on hash maps, which shows buckets, collisions and a table growing.
-
الدرس 10 · المدة: 14 د
Chaining vs probing: expected cost and clustering
الخطوات: 9لم يبدأ -
الدرس 11 · المدة: 14 د
Load factor, resizing and universal hashing
الخطوات: 8لم يبدأ -
الدرس 12 · المدة: 12 د
Binary heaps: sift up and sift down
الخطوات: 8لم يبدأ -
الدرس 13 · المدة: 14 د
Priority queues and heapsort
الخطوات: 8لم يبدأ
Search trees
Trees that keep data sorted, and how they stay balanced. Builds on the Software lesson on trees, which covers search, insert and a tree that turns into a line; the Databases lesson on B-trees covers wide nodes on disk.
-
الدرس 14 · المدة: 14 د
Tree traversals: pre-order, in-order, post-order and level order
الخطوات: 9لم يبدأ -
الدرس 15 · المدة: 14 د
BST delete, successor and predecessor
الخطوات: 10لم يبدأ -
الدرس 16 · المدة: 14 د
AVL trees and rotations
الخطوات: 9لم يبدأ -
الدرس 17 · المدة: 15 د
2-3 trees and red-black trees
الخطوات: 10لم يبدأ -
الدرس 18 · المدة: 14 د
Tries: trees of letters
الخطوات: 10لم يبدأ
Graph algorithms
Storing graphs and walking them in order. Builds on the Software lessons on graphs and on BFS and DFS, and the Maths lesson on graph theory.
-
الدرس 19 · المدة: 14 د
Adjacency lists and adjacency matrices
الخطوات: 9لم يبدأ -
الدرس 20 · المدة: 14 د
Multi-source and 0-1 BFS on grids
الخطوات: 10لم يبدأ -
الدرس 21 · المدة: 14 د
DFS in depth: discovery times and cycle detection
الخطوات: 10لم يبدأ -
الدرس 22 · المدة: 14 د
Topological sort
الخطوات: 10لم يبدأ -
الدرس 23 · المدة: 14 د
Connected components and grid flood fill
الخطوات: 8لم يبدأ -
الدرس 24 · المدة: 14 د
Union-find: merging groups fast
الخطوات: 10لم يبدأ -
الدرس 25 · المدة: 15 د
Strongly connected components
الخطوات: 11لم يبدأ
Greedy and divide and conquer
Two ways to design an algorithm, and how to prove they work. Builds on the Software lessons on sorting (insertion sort, merge sort, Timsort) and recursion and the Maths lesson on proofs.
-
الدرس 26 · المدة: 14 د
Greedy choices: the exchange argument and when greedy fails
الخطوات: 10لم يبدأ -
الدرس 27 · المدة: 14 د
Interval scheduling
الخطوات: 10لم يبدأ -
الدرس 28 · المدة: 14 د
Huffman coding
الخطوات: 10لم يبدأ -
الدرس 29 · المدة: 14 د
Merge sort's recurrence and counting inversions
الخطوات: 8لم يبدأ -
الدرس 30 · المدة: 15 د
Quicksort and quickselect: partitions and pivots
الخطوات: 9لم يبدأ -
الدرس 31 · المدة: 14 د
Why comparison sorts can't beat n log n
الخطوات: 10لم يبدأ -
الدرس 32 · المدة: 14 د
Counting sort and radix sort
الخطوات: 11لم يبدأ
Shortest paths and spanning trees
Cheapest routes and cheapest networks over weighted graphs. Uses the heaps and union-find from earlier modules and the greedy proofs from the module before.
-
الدرس 33 · المدة: 14 د
Dijkstra's algorithm
الخطوات: 11لم يبدأ -
الدرس 34 · المدة: 14 د
Bellman-Ford and negative edges
الخطوات: 9لم يبدأ -
الدرس 35 · المدة: 14 د
Shortest paths in a DAG
الخطوات: 10لم يبدأ -
الدرس 36 · المدة: 14 د
Minimum spanning trees with Kruskal
الخطوات: 10لم يبدأ -
الدرس 37 · المدة: 14 د
All-pairs shortest paths with Floyd-Warshall
الخطوات: 10لم يبدأ -
الدرس 38 · المدة: 14 د
Minimum spanning trees with Prim
الخطوات: 11لم يبدأ
Dynamic programming and backtracking
The common shapes of dynamic programming, and searching every option without wasting work. Builds on the Software lesson on dynamic programming, which covers memoisation and tables.
-
الدرس 39 · المدة: 14 د
Defining states and transitions
الخطوات: 9لم يبدأ -
الدرس 40 · المدة: 14 د
The knapsack problem
الخطوات: 9لم يبدأ -
الدرس 41 · المدة: 15 د
Longest common subsequence and edit distance
الخطوات: 11لم يبدأ -
الدرس 42 · المدة: 14 د
Longest increasing subsequence
الخطوات: 10لم يبدأ -
الدرس 43 · المدة: 14 د
Grid paths and counting
الخطوات: 10لم يبدأ -
الدرس 44 · المدة: 14 د
Backtracking: subsets and permutations
الخطوات: 9لم يبدأ -
الدرس 45 · المدة: 14 د
N-queens and pruning
الخطوات: 10لم يبدأ
Strings and problem-solving patterns
Fast text search and the patterns that crack most interview problems. Builds on the Software lessons on strings and on searching.
-
الدرس 46 · المدة: 12 د
Naive string search
الخطوات: 9لم يبدأ -
الدرس 47 · المدة: 15 د
KMP: never look back
الخطوات: 9لم يبدأ -
الدرس 48 · المدة: 14 د
Rabin-Karp and rolling hashes
الخطوات: 9لم يبدأ -
الدرس 49 · المدة: 12 د
Two pointers
الخطوات: 9لم يبدأ -
الدرس 50 · المدة: 15 د
Sliding window
الخطوات: 9لم يبدأ -
الدرس 51 · المدة: 14 د
Binary search on the answer
الخطوات: 10لم يبدأ -
الدرس 52 · المدة: 12 د
Prefix sums
الخطوات: 8لم يبدأ
Special topics
Stand-alone deep dives. Take them any time after the module they build on.
-
الدرس S1 · المدة: 15 د
Segment trees and Fenwick trees
يعتمد على Search trees
الخطوات: 10لم يبدأ -
الدرس S2 · المدة: 14 د
Bloom filters
يعتمد على Hashing and heaps
الخطوات: 9لم يبدأ -
الدرس S3 · المدة: 14 د
A* search
يعتمد على Shortest paths and spanning trees
الخطوات: 9لم يبدأ -
الدرس S4 · المدة: 14 د
Max flow and min cut
يعتمد على Shortest paths and spanning trees
الخطوات: 10لم يبدأ -
الدرس S5 · المدة: 14 د
P, NP and hard problems
يعتمد على Dynamic programming and backtracking
الخطوات: 10لم يبدأ