Skip to content

Minimal state [mp]

Micro pattern

Description

Retain the smallest summary needed for future input instead of the complete history.

Problems

Candidate state

Keep a bounded collection of candidates and counters.

Balance or bounded-window state

Track a scalar balance or a bounded collection of active keys.

Compressed DP state

Replace a table with the previous states required by its recurrence.

Boundary summaries

Keep only the strongest boundary observed from each side.

Deferred arithmetic state

Keep completed totals and only the operands and operator needed for the next update.