Books / Visual learning guide
Data Structures & Algorithms Through Stories — Visual Learning Guide
Theme: Computing & AI
Learn to choose, trace and justify data structures and algorithms through concrete delivery-desk problems. This complete twelve-chapter Visual Learning Guide companion develops the reasoning behind lists, queues, maps, searching, sorting, trees, heaps, graph traversal, weighted paths, greedy choices and dynamic programming. Original diagrams make changing state visible, while complete Python examples connect each procedure to its input contract, invariants and cost assumptions. Worked examples, counterexamples and practice with full answers help readers check understanding rather than memorize names. The chapter sequence moves from a first minimum scan to reconstructing optimal loads and combining tools responsibly. Designed for independent study alongside the story collection, the guide also provides a structured route into algorithmic thinking, with clear prerequisites, implementation boundaries and primary references for further reading.
Start reading →View in the interactive libraryAbout this book
A delivery desk provides a concrete starting point for algorithmic thinking: select the next parcel, keep a changing manifest, find a destination, or decide which jobs can share a loading bay. This companion translates those situations into clear questions about inputs, outputs, constraints and guarantees. It develops the ideas through original explanatory prose, diagrams and dry runs, so a reader can understand why a method fits before learning its name or implementation. The learning sequence begins with a simple minimum scan. Distinguishing a parcel from its current index leads naturally to array layouts, shifting, capacity growth and linked structures. Stack and queue interfaces then make ordering policies explicit. Hash tables introduce collisions, load and deletion state, while binary search emphasizes a shrinking interval and the exact boundary being sought. Sorting chapters compare stable merging, local insertion, partitioning and bounded-key counting under clearly stated assumptions. Trees and heaps deepen the connection between structure and proof. Search-tree bounds explain lookup and updates; rotation diagrams show how local changes preserve ordered relationships. Heap traces expose one useful extreme without pretending the entire array is sorted. Arrival counters, key changes and bounded shortlist selection connect priority queues to practical requirements. Graph chapters distinguish road connectivity, fewest hops and prerequisite order, making queue layers, parent links, active calls and finish order visible. The final part extends these foundations to weighted shortest paths, the conditions behind a safe greedy choice, and dynamic programming. A fastest route is a different question from a fewest-road route. An attractive local decision needs an exchange argument or a counterexample. A table of remembered answers needs a precise state definition, valid transitions and a way to recover the selected choices. These later topics complete the progression from storing information to proving and combining decision procedures. Python examples are presented as complete teaching implementations or clearly identified conceptual designs. Their contracts state what the caller must supply and what the function preserves or returns. Analysis distinguishes worst-case, expected and amortized claims, includes representation and allocation costs where relevant, and separates input storage from additional workspace. Tests check boundary cases, duplicates, changing state and the complete promised result. A fast-looking trace is never treated as a proof of correctness. Each chapter contains worked reasoning, misconception checks, fresh practice and full answers. Readers can pause at a state diagram, predict the next transition, run the code, or challenge an assumption with a small counterexample. Source mappings connect the companion to the corresponding story chapter, and primary references support further reading. The material is independently authored educational content, not a prescribed syllabus or a promise of interview outcomes. The complete twelve-chapter sequence spans 132 pages, with one guide chapter corresponding to each story chapter. Start with the opening chapters if invariants and complexity are new, or revisit the relevant prerequisite before using a later algorithm. The final synthesis explains why individually optimal subroutines do not automatically optimize a coupled delivery problem. The aim throughout is transferable judgment: state the problem accurately, choose a justified tool, and verify the result.
Published chapters
- The Parcel That Exposed the Plan — Visual Learning Guide
A context-first guide to choosing a first minimum, translating a rule into Python, tracing ties, proving a loop invariant, measuring linear and quadratic growth, and testing the full input-output promise.
- Shelves That Grow and Chains That Bend — Visual Learning Guide
Visual shifts, geometric-growth accounting and safe pointer rewiring explain arrays and linked lists, including logical bounds, shrinking, endpoints, memory locality and workload choices.
- The Door and the Undo Button — Visual Learning Guide
FIFO and LIFO become concrete through complete ring-buffer, two-stack queue and bracket-matching implementations, with wraparound traces, amortized accounting, explicit errors and worked practice.
- The Address With Too Many Neighbors — Visual Learning Guide
Key-value identity, chained lookup, probabilistic bounds and complete bounded linear-probing code make collisions, tombstones, replacements and rehashing explicit.
- Half the Search and a Smaller Promise — Visual Learning Guide
Half-open boundaries, full traces and invariants lead from crate selection to iterative and recursive lower-bound search, then contrast halving with linear-depth recursion and complete worked practice.
- The Manifest Must Keep Its Promises — Visual Learning Guide
Original traces and tested Python implementations compare stable insertion and merge sorting, unstable last-pivot quicksort, and stable counting sort, with identity checks, proofs and worked answers.
- A Tree That Leaned Too Far — Visual Learning Guide
Search paths, complete ordinary BST updates, preserved successor subtrees and tested rotations establish ordered trees before AVL height invariants and repair requirements are introduced.
- The Next Parcel Is Not the Whole Order — Visual Learning Guide
Complete heap code, original repair traces and linear-build accounting lead to stable dispatch keys, honest update costs, lazy invalidation and tested streaming earliest-k selection.
- The City Becomes a Graph — Visual Learning Guide
Original graph diagrams, queue and call-stack traces, complete BFS and topological-order implementations, shortest-hop proofs, route reconstruction and fully answered practice connect graph storage to meaningful guarantees.
- The Shortest Road Needs a Condition — Visual Learning Guide
Weighted-route traces, an original settlement proof, complete lazy-heap Dijkstra and copy-based Bellman-Ford, exact route witnesses, negative-cycle boundaries and full practice answers connect shortest paths to their assumptions.
- A Good First Choice Needs a Proof — Visual Learning Guide
Loading-bay timelines, a complete exchange argument, tested interval scheduling and exact fractional loading distinguish justified greedy commitments from token and whole-parcel counterexamples, with full practice answers.
- Remember the Work and Choose the Tool — Visual Learning Guide
Precise state definitions, complete knapsack tables, proofs and reconstruction lead to memoization, rolling-array version reasoning, pseudo-polynomial costs and minimum-token witnesses, then an honest synthesis of the book's tools.