Skip to main content

Advanced Structures Reference

Choose by the operation contract​

NeedCandidateBoundary to check
Ordered lookup, rank and selectionAugmented AVL mapUnique keys, replacement policy, deletion and size maintenance
Incremental undirected connectivityUnion by size with path compressionInitialization, redundant edges, no paths or arbitrary deletion
Destructive melding of priority queuesBinomial heapDonor ownership, duplicate keys, no implicit stable handles
Append sequenceGeometrically growing arrayCost unit, resize latency, initial state and peak storage
Point addition and range sumFenwick treeHalf-open indexing and additive inverses
Range assignment/addition and sumLazy segment treeTag chronology, segment length and identity
Branching historical point updatesPersistent sum treeImmutable sharing, retained roots and historical membership
Negative membership shortcutBloom filter plus exact storeCovered population, stable hashing, no unsafe clearing

Read the operation and resource contracts before adapting code. The reading guide maps local books to questions, and resources records primary references.

Proof and verification cards​

For each chosen structure record its state invariant, legal operations, ownership, input domain, output contract, worst-call bound, sequence/expected bound, and space model. Add one minimal failing sequence and one independent model check. Separate a proved theorem from a measured observation and an untested hypothesis.

The practice key contains derivations; the assessment key is intended for review after an independent attempt. Use the mistake clinic to repair actual misconceptions rather than collect a quota of mistakes.