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 08:25:59 UTC · snapshot created 2026-10-03 08:26:43 UTC · last check 2026-10-03 09:35:10 UTC

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

Misstep exposed by the methodConsequence and repair
Return only the final scalar from each partThe segment example loses crossing answers. Derive the join and retain the boundary summaries it consumes.
Treat a changed input as a smaller inputCalls can continue indefinitely. State a well-founded decrease and check every recursive branch against it.
Treat termination as affordabilityAn exponential call tree can terminate correctly. Count calls and local work; share repeated subproblems when useful.
Keep the old summary after changing the questionA length constraint or witness request can be lost. Reconstruct what the new join needs and revise the affected result.