Mistake Clinic
Module-Specific Mistake Radar
| Symptom | Underlying error | Small falsification |
|---|---|---|
| Sorted keys but reordered ties | Compared payloads or chose the right merge head on equality | Two equal keys with distinct tags |
| Search returns any matching duplicate | Wrong output contract | Three equal keys and a boundary query |
| Search stalls | No strictly shrinking interval | One-element active interval with lo=mid |
| Random-pivot quicksort is quadratic on ties | Equal keys all sent to one recursive side | All-equal array |
| Selection called worst-case linear | Expected bound used as a guarantee | Extreme pivot sequence |
| Deleted neighbor becomes unreachable | Empty and deleted states conflated | Collision chain; delete its first entry |
| Old map value reappears | Inserted at tombstone before finding existing key | Delete head, update later key, delete it |
| Low-load map is slow | Deterministic collision family ignored | Multiples of capacity |
| Heap construction analysis is n log n | Charged root height to all nodes | Height-sum derivation |
| Merge exhausts memory | Flattened inputs or retained all output internally | Guarded generators and source inspection |
| External-sort time is halved | Counted merge but omitted run generation | Read/write ledger for every stage |
| Radix allegedly sublinear | Dropped pass ceiling and input traversal | Fixed-width keys still require one pass |
Practice Mistake Checks
For P1–P4, verify stability, multiplicity and model assumptions separately. For P5–P8, write bounds and rank conventions before code. For P9–P12, use operation histories and name the probability space. For P13–P16, price input/output and retained state rather than only the central loop.
Record a real failure, the smallest reproducing input, violated invariant, repair, and fresh successful case. A copied fix without an explanation remains incomplete. Use Practice Solutions only after preserving your attempt.