Concepts5
Think Backwards (Reverse Thinking)
Think Backwards is a problemβsolving pattern where you reverse time or direction so hard deletions become easy insertions and the final state becomes the starting point.
Invariant Maintenance
An invariant is a property you promise to keep true throughout an algorithm, and it is the anchor of both design and correctness proofs.
MST Properties and Applications
An MST minimizes total edge weight over all spanning trees and has powerful properties such as the cut and cycle properties that guide correct, greedy construction.
DSU with Weighted Edges
A DSU with weighted edges (also called a potential or difference-constraint union-find) maintains relative values between elements while still supporting near-constant-time merges and finds.
Disjoint Set Union (Union-Find)
Disjoint Set Union (Union-Find) maintains a collection of non-overlapping sets and supports fast merging and membership queries.