Skip to content

Fill remaining content gaps; fix appendix errors; expand glossary and cheat sheet - #2

Merged
dnakhoa merged 8 commits into
mainfrom
claude/course-improvements-pyoyiu
Nov 6, 2026
Merged

dnakhoa merged 8 commits into
mainfrom
claude/course-improvements-pyoyiu

Conversation

@dnakhoa

@dnakhoa dnakhoa commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

New content (each with tested Python and new exercises):

  • Ch 12 Hash tables: Robin Hood hashing (backward-shift deletion, measured probe statistics), Swiss tables (control bytes, H1/H2 split, group probing), a scheme comparison with who uses what, and hash flooding and its defences.
  • Ch 13 Strings: KMP prefix function, Z-array, Rabin-Karp rolling hashes with collision bounds. Text editor buffers (gap buffer, rope, piece table, VS Code's piece tree), with a piece-table diagram.
  • Ch 5 Stacks and queues: monotonic stacks and deques (next greater element, histogram rectangle, sliding-window maximum) with the amortized analysis.
  • Ch 3 Arrays: compressed bitmaps, centred on Roaring.
  • Ch 24 Research-grade: the predecessor problem; van Emde Boas trees (tested implementation and diagram), x-fast and y-fast tries, fusion trees and lower bounds.
  • Ch 30 Search: posting-list compression (d-gaps, varint, FOR/PForDelta, with a diagram), intersection (galloping, skip pointers), WAND top-k, and segments vs LSM trees.

Fixes

  • HyperLogLog error was stated as about 2% in four places. It is 0.81% at 12 KB, as Chapter 14 itself derives.
  • Appendix A: the pairing-heap decrease-key bound was unproven (the exact bound is open), and the Li Chao tree build cost was wrong.
  • Ch 1 listed van Emde Boas operations as O(log n). They are O(log log u).
  • Ch 12 overstated how platforms responded to the 2011 hash-flooding attack.
  • Spacing: 33 places across 16 files were missing a space after a closing parenthesis, left over from the earlier em-dash cleanup.

Reference pages

  • Appendix A gains array and sequence techniques, caches and load balancing, string matching, posting-list intersection, plus many new rows.
  • Glossary goes from 56 to 106 terms, with new Graphs and Techniques sections.
  • Overviews and counts: the volume overviews and README counts are updated (241 exercises, ~185,000 words).

Verification

  • python3 scripts/check_book.py passes.
  • mdbook build emits no warnings.
  • New diagrams were checked in light and dark themes.

Generated by Claude Code

Appendix A: HyperLogLog error was given as ~2% (it is 0.81% standard
error at 12 KB, as Chapter 14 itself derives); pairing-heap decrease-key
was stated as O(log log n), which is unproven (the exact bound is open);
Li Chao tree build was O(n) rather than O(n log C). Adds CSR, circular
buffers, bit arrays, order-statistic trees, indexed heaps, SCC, cycle
detection, 0-1 BFS, DAG shortest paths, Johnson's algorithm, and new
sections for array/sequence techniques and for caches and load balancing.

The same HyperLogLog figure is corrected in Chapter 14's intro, Appendix B
and the glossary. Also restores 30 missing spaces after closing
parentheses left behind when em-dash pairs were converted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
New section on the predecessor problem in the word-RAM model: a tested
van Emde Boas tree (member, insert, successor, delete) with a worked
u = 16 example and diagram, x-fast and y-fast tries, fusion trees and the
known lower bounds stated carefully, and when B-trees still win. Three
exercises.

Also fixes Chapter 1, which listed van Emde Boas operations as
O(log n); they are O(log log u) for integer keys below u.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
Adds the prefix function (KMP) as a data structure, its link to
Aho-Corasick failure links, the Z-array, and rolling hashes / Rabin-Karp
with collision bounds and why the base must be random. Adds the
structures text editors use: gap buffer, rope and piece table (with a
diagram) and VS Code's piece tree, with runnable gap buffer and piece
table implementations and a comparison table. Three exercises, including
the Thue-Morse attack on 64-bit polynomial hashing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
Adds posting-list compression (d-gaps, varint, frame-of-reference and
PForDelta, with a worked byte-level example and diagram), intersection
by merging, galloping and skip pointers, WAND and block-max WAND top-k
retrieval, and Lucene-style immutable segments compared with LSM trees.
Three exercises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
…ues sections

Covers the graph vocabulary from Chapter 11, the array and pointer
techniques from Chapters 3-4, BST and B-tree terms from Chapters 7 and 10,
text editor buffers and string matching from Chapter 13, the word-RAM
model from Chapter 24, cache and load-balancing terms from Chapter 29,
and posting-list terms from Chapter 30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
…apter 3

Chapter 5 gains a section on monotonic stacks and queues: next greater
element, the amortized O(n) argument by aggregate and potential methods,
stock span, largest rectangle in a histogram, and sliding-window maximum
with a monotonic deque. Three exercises (one reworked so it no longer
repeats the new body text).

Chapter 3 gains compressed bitmaps: why plain bitmaps waste space on
sparse sets, WAH/EWAH, and Roaring bitmaps in depth (containers, the 4096
crossover, intersection) with a runnable model. Two exercises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
Adds Robin Hood hashing (swap-on-insert, early-terminating misses,
backward-shift deletion) with a tested implementation and measured probe
statistics, Swiss tables (control bytes, H1/H2 split, group probing) with
a Python model, a comparison of chaining, linear probing, Robin Hood and
Swiss tables with who uses each, and hash flooding (the 2011 attacks,
random seeds, SipHash, tree bins). Three exercises. Corrects the claim
that the 2011 attack forced every affected platform to change its hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
Adds glossary terms for Robin Hood hashing, Swiss tables, control bytes,
hash flooding, SipHash, Roaring bitmaps, monotonic stacks and van Emde
Boas trees. Appendix A gains rows for text-editor buffers, integer
structures, Robin Hood and Swiss tables, Roaring bitmaps, and new tables
for string matching and posting-list intersection. Volume I and II
overviews mention the new sections; README and landing page counts are
updated (~185,000 words, 241 exercises).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga8rBjM4kRZRhxKLznhSca
@dnakhoa
dnakhoa merged commit 5ef3089 into main Nov 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants