Fourteen days of drills that turn data structures and algorithms into something you can use under pressure.
This is a book of problems. Every rule is stated in as few words as it can be, shown working in a short program with its real captured output, and then handed back as drills. Nothing is asserted that is not also demonstrated: every listing in the book was compiled and run with Rust 1.97.1, and every printed result was captured from that run.
The programming problems build one real tool across the fourteen days. It is called tally, a command-line text index. It begins on Day 1 as a word counter and gains, day by day, a growing buffer, a document list, a query parser, a directory walk, a ranking, a heap, a sorted vocabulary, a hash index, a search tree, a trie, a graph of related terms and a comparison of two documents. Each day's tool is the previous day's with one structure added, so the reason for a structure arrives before it does.
Rust is not a passenger here. Ownership decides how a linked list is written, why a tree is held in one vector rather than a Box per node, and what a deletion is allowed to touch. Those decisions are shown as measurements, not as opinions: an arena builds a hundred thousand nodes in two thirds of the time and half the memory of one Box per node, and the book prints both numbers.
The two weeks run in three movements. Days 1 to 5 build the foundations: the cost model, arrays, linked lists, stacks and queues, and recursion with backtracking. Days 6 to 9 cover sorting, heaps and priority queues, searching and two pointers, and hash tables. Days 10 to 14 cover binary search trees, balanced trees and tries, graphs and traversal, shortest paths, and dynamic programming and greedy algorithms.
Every chapter has the same shape. Numbered sections state the rules. Twenty worked examples show each rule running, each with a complete program, its real output, a figure and a short explanation. Then a fixed ladder of five problem sets: review questions, worked problems with full solutions, worked programming problems, and unassisted practice problems in both written and programming form. The review answers are at the end of the chapter; the practice problems have no answers anywhere, by design.
YOUR 14-DAY PATH
WEEK 1 - FOUNDATIONS AND SORTING
- Day 1 - Complexity and the Cost Model
- Day 2 - Arrays and Dynamic Arrays
- Day 3 - Linked Lists
- Day 4 - Stacks and Queues
- Day 5 - Recursion and Backtracking
- Day 6 - Elementary and Divide-and-Conquer Sorting
- Day 7 - Heaps, Priority Queues and Linear-Time Sorting
WEEK 2 - SEARCHING, TREES, GRAPHS AND DESIGN METHODS
- Day 8 - Searching, Binary Search and Two Pointers
- Day 9 - Hash Tables
- Day 10 - Binary Trees and Binary Search Trees
- Day 11 - Balanced Trees and Tries
- Day 12 - Graphs and Traversal
- Day 13 - Shortest Paths, Spanning Trees and Topological Order
- Day 14 - Dynamic Programming and Greedy Algorithms
WHO IT'S FOR
Students taking a data structures course who want drills rather than a reference. Readers preparing for an examination or a technical interview. Working programmers who want fluency in the structures they already use by name. One programming language is assumed: loops, functions and arrays. No prior work on data structures is assumed. Rust is taught only where a structure needs it, so a reader who knows another language can follow the drills and pick up the language on the way.
281 worked examples. 463 figures. 736 problems. 390 pages. Written to Rust 1.97.
Fourteen days. Work them in order, and do the problems.