All courses
Data Structures and Algorithms
Data Structures
Start the course First: Primitive Types and Data in Memory
The route
Lessons are in the order that makes each one easier than the last. Each unit ends with a short quiz.
- 0/5Unit 1
Foundations, Complexity and Design
Types and memory, abstract data types, big-O and growth classes, recursion and recurrences, and the OOP patterns used to build data structures.- Primitive Types and Data in MemoryFree A variable is not a box with a name. It is an address and a set of rules for reading what is there. 12 min
- Abstract Data Types and the Structure Taxonomy First decide what the structure promises. Only then decide how the bytes will sit. 11 min
- Big-O Notation and Growth Classes Big-O is not about seconds. It is about how the work grows when the input grows. 13 min
- Recursion and Recurrence Relations Recursion is a function calling itself on a smaller problem — and big-O needs a machine for when the calls multiply. 14 min
- OOP Concepts and Design Patterns in Data Structures The best containers hide their internals. Patterns are how libraries keep that promise at scale. 12 min
- Unit 1 quiz5 questions on this unit 6 min
- 0/4Unit 2 Full plan
Arrays, Records, Matrices and Strings
Address arithmetic, dynamic arrays and sparse matrices, records and C pointers, and string representation and pattern processing.- Arrays and Address Arithmetic An array is not a list. It is one block of memory and a formula for finding the nth element. 12 min
- Dynamic Arrays, Matrices and Sparse Matrices Arrays are born full-sized. Dynamic arrays are the polite lie: they grow exactly when they must. 13 min
- Records, Structs and Pointers in C A record groups different types under one name — and a pointer is just an address wearing a type. 12 min
- Strings and String Pattern Processing The most-used structure in programming is an array with a hidden length problem. 12 min
- Unit 2 quiz5 questions on this unit 6 min
- 0/5Unit 3 Full plan
Linked Lists, Stacks and Queues
Singly, doubly and circular linked lists, LIFO stacks for brackets and expressions, and FIFO queues and circular buffers.- Pointers, References and the Singly Linked List A linked list trades address arithmetic for address holding: slower to reach a position, free to insert one. 12 min
- Doubly Linked Lists, Circular Lists and Reversal Two pointers cost you one. A circular list costs you the sense that there is an end. 13 min
- Stacks: Last In, First Out A stack is the data structure the machine itself uses, which is why recursion and function calls feel the same. 12 min
- Infix, Postfix and Prefix Expression Evaluation Computers do not love parentheses. They love stacks. 14 min
- Queues, Circular Buffers and Deques A queue is fair. A circular queue is a queue that does not leak the space it has already used. 14 min
- Unit 3 quiz5 questions on this unit 6 min
- 0/4Unit 4 Full plan
Trees, Heaps and Hashing
Binary trees and traversals, binary search trees, heaps and balanced trees, and hash tables with chaining and linear probing.- Binary Trees and Their Traversals A traversal is a definition, not a loop. Recursion writes it in three lines and the machine supplies the stack. 14 min
- Binary Search Trees A search tree is an ordered structure disguised as a tree. Its speed is the height, and its height is the order of insertion. 12 min
- Heaps, Priority Queues and Balanced Trees A heap is a tree with one promise instead of many, which is why it is fast and why it is stored in an array. 12 min
- Hash Tables and Collision Resolution A hash function turns a key into an index, so the cost of a lookup is the cost of the collision handling. 13 min
- Unit 4 quiz5 questions on this unit 6 min
- 0/4Unit 5 Full plan
Searching, Sorting and Graphs
Linear, binary and jump search, elementary and divide-and-conquer sorts, and graphs with BFS and DFS.- Linear, Binary and Jump Search Binary search is not "faster". It is faster only when the data is sorted — and sorting costs more than the search saves if you search once. 14 min
- Elementary Sorts — Bubble, Selection and Insertion Three O(n²) sorts, three different costs inside the class — and the one you will actually use. 13 min
- Merge Sort, Quick Sort, Bucket and Radix Sort Merge sort and quicksort both split the problem, and they divide the work between themselves. 15 min
- Graphs — Representations, BFS and DFS A graph is the shape of any relationship that is not a chain and not a tree: roads, friendships, the web. 15 min
- Unit 5 quiz5 questions on this unit 6 min
- 0/3Unit 6 Full plan
Runtime Storage, Compression and Synthesis
Stack and heap lifetimes, garbage collection, Huffman coding and run-length encoding, and choosing a structure for a workload.- Runtime Storage: Stack, Heap and Lifetime Stack memory is freed for you and heap memory is not, and almost every memory bug comes from mixing up which is which. 12 min
- Garbage Collection and Data Compression A garbage collector frees heap memory for you; Huffman coding builds the smallest codes for the most common letters. 14 min
- Choosing a Structure — Full-Course Synthesis The right structure is the one whose expensive operation is the one you do least. 14 min
- Unit 6 quiz5 questions on this unit 6 min