Data Structures & Algorithms / Contracts, sequences, and search
Data Structures & Algorithms β Contracts, sequences, and search
Invariants, cost models, prefix sums, linked nodes, stacks, queues, hashing, and binary boundaries.
What you will learn
- Invariants, cost models, prefix sums, linked nodes, stacks, queues, hashing, and binary boundaries.
Contracts, invariants, and cost models
Prove what a loop computes, count the work it performs, and state the assumptions behind asymptotic claims.
Start learningArrays, prefix sums, and range contracts
Use half-open intervals to preprocess repeated sum queries and distinguish static queries from range updates.
Start learningLinked nodes, ownership, and traversal
Separate constant-time pointer changes from the search needed to find their location, and preserve reachability invariants.
Start learningStacks, queues, and ordering policies
Choose removal order from the task and prove that the container preserves the unfinished work it represents.
Start learningHash maps, membership, and duplicates
Use hashing for identity and counting while preserving duplicate semantics and qualifying expected-time claims.
Start learningBinary search and boundary invariants
Derive lower-bound search from a partition invariant and handle duplicates and absence without guessing midpoint rules.
Start learning