Mistake Clinic
Module-Specific Mistake Radar
| Symptom | Separating sequence | Repair |
|---|---|---|
| Lookup passes but rank fails | Rotate, replace, delete, then select | Recompute sizes independently of height |
| Local ordering passes an illegal tree | 10-left-5-right-12 | Carry subtree bounds |
| Repeated union enlarges a component | Union a pair twice | Check roots before merging sizes/count |
| Deleted graph edge still connected | Insert path then delete bridge | Change event model; ordinary DSU cannot split |
| Meld indexes past root slots | High-degree donor into small/empty receiver | Allocate skipped slots and carry correctly |
| Reused donor changes receiver | Meld then push into donor | Transfer ownership and empty donor |
| Copy counts match only full sizes | Check append immediately after a power of two | Prove every prefix, not selected n |
| Queue credits do not pay transfer | Count pop and push separately | Use two transfer credits per element |
| Assigned zero disappears | Assign whole range zero, query subrange | Distinguish identity from assignment-zero |
| Lazy updates reverse time | Assign then add versus add then assign | Compose new-after-old |
| Branch reads latest version | Fork version 0 after version 1 exists | Use the requested root and immutable nodes |
| Zero quantity appears absent | Store key with value zero | Track presence separately |
| Filter invents exact membership | One-bit filter with an absent query | Confirm positives against exact data |
| Filter hides an old key | Rebuild only from latest version | Cover all queried retained versions |
| Expected bound presented as worst case | Supplied treap priorities form a chain | State randomness model and guarantee type |
Practice Mistake Checks
For P1–P7 inspect ordering, metadata and event semantics. For P8–P14 inspect ownership, initial state, primitive units and sequence accounting. For P15–P20 inspect probability assumptions, algebraic order, historical isolation and representation cost. Save a real minimal failing sequence and a fresh successful recheck; do not fabricate mistakes to reach a quota.