Library / Computational Thinking DPF
Jump to passage
In this reading

Link to current text

Published source confirmed at last check

Source changed 2026-10-03 10:39:28 UTC · snapshot created 2026-10-03 10:40:04 UTC · last check 2026-10-03 11:25:15 UTC

CMP.11:8 - Common Anti-Patterns and How to Avoid Them

Tempting moveFailureUseful repair
Generalize from a slow implementationAnother algorithm may avoid its work.Prove a requirement for every admitted transcript or procedure.
Count distinct inputs without considering acceptable answersSeveral inputs may legitimately share one output.Count output-distinct classes.
Supply an inconsistent adversaryNo actual input could produce its replies.Retain a nonempty compatible input family.
Fix randomness, then choose a different hard input for each seedThis can miss a successful randomized algorithm.Use one prior input distribution or a valid coupled argument.
Ignore input-dependent preprocessing or stronger accessThe algorithm already acquired the supposedly missing information.Charge or expose that resource and restate the model.