Part 1Getting started: how fastCounting steps, Big O, where log n comes from, and what each built-in list, dict and set operation costs.4 lessons · 1 h
Part 2Names, lists and linked listsVariables are labels on objects: aliases and copies; a list is a row of references: indexing, inserting, deleting, growing; linked lists by hand, nodes, inserting and deleting, doubly linked lists and an LRU cache.8 lessons · 2.5 h
- Lesson 5Names and objects: references, aliases and copies17 minStart
- Lesson 6Inside a list: a row of references18 minStart
- Lesson 7Inserting and deleting in a list18 minStart
- Lesson 8Arrays that grow: resizing by hand19 minStart
- Lesson 9Linked lists: nodes and next15 minStart
- Lesson 10Inserting and deleting in a linked list16 minStart
- Lesson 11Doubly linked lists, circular lists and an LRU cache18 minStart
- Lesson 12Patterns: lists and linked lists20 minStart
Part 3Stacks and queuesA list as a stack, matching brackets, postfix expressions; why a queue wants deque, a circular queue by hand, monotonic stacks and sliding windows.5 lessons · 1.5 h
Part 4Hash tables: dict and setHash functions and __hash__, open addressing (what CPython's dict does), chaining and resizing, and two-sum, Counter and grouping problems.4 lessons · 1.5 h
Part 5Trees and heapsBinary trees and recursion, four traversals, rebuilding a tree, binary search trees, a heap by hand and then heapq, heap sort and top-k, Huffman coding, every step drawn on the tree.8 lessons · 2.5 h
- Lesson 22Binary trees and recursion15 minStart
- Lesson 23Four ways to walk a binary tree18 minStart
- Lesson 24Rebuilding a tree from its traversals18 minStart
- Lesson 25Binary search trees18 minStart
- Lesson 26Heaps and heapq18 minStart
- Lesson 27Heap sort and top-k18 minStart
- Lesson 28Huffman trees and Huffman codes18 minStart
- Lesson 29Patterns: trees20 minStart
Part 6GraphsAdjacency matrices and lists, BFS and DFS, topological sort, Dijkstra with heapq, Kruskal (union-find) and Prim, every step drawn on the graph.7 lessons · 2 h
- Lesson 30Storing a graph: adjacency matrix and list16 minStart
- Lesson 31Breadth-first search (BFS)17 minStart
- Lesson 32Depth-first search (DFS)17 minStart
- Lesson 33Topological sort16 minStart
- Lesson 34Shortest paths: Dijkstra18 minStart
- Lesson 35Minimum spanning trees: Kruskal and Prim18 minStart
- Lesson 36Patterns: graphs22 minStart
Part 7SearchingBinary search and its bounds, bisect, balanced trees (AVL rotations), and binary search on the answer.4 lessons · 1 h
Part 8SortingBubble, selection, insertion, Shell, merge, quick, counting and radix sort, each run for real with its comparisons counted; then sorted() keys, stability and Timsort.6 lessons · 2 h
Part 9Algorithm designRecursion and divide and conquer, backtracking, greedy, dynamic programming (from recursion to lru_cache to a table) and knapsack problems.6 lessons · 2.5 h
Questions
Is it really free?
Yes. Every lesson, example and exercise is free, with no sign-up.
Do I need to know Python first?
A little: variables, loops, functions, lists and dicts, ideally classes too. If not, start with our Python course.
How is it different from the C edition?
The same chapters, taught the Python way: no pointers or malloc, more on references, how list and dict work inside, and the standard library tools.
Is there a C++ edition?
Yes: Data Structures and Algorithms in C++, each structure by hand first, then with the STL (/en/learn/dsa-cpp/).
Where is my progress kept?
In this browser, with no account.