Structures for prefixes, places, ordering and pipelines.
A tree where each edge is one character, so the path from the root to a node spells a prefix and every word below that node starts with it. It exists because "all words starting with sys" is one walk of three nodes, not a scan of the dictionary.
Costs
Prefix lookup: O(p) · Top-k completions: O(p + k) · Insert: O(L) · Delete: O(L)
A map from each word to the sorted list of document ids that contain it, the reverse of a document-to-words mapping. It exists because "find every document with these words" becomes intersecting a few short lists instead of reading every document.
Costs
Single-term lookup: O(1) + list length · AND of two terms: O(|A| + |B|) · Ranked top-k: O(matches × log k) · Add a document: O(terms in doc) · Delete a document: O(1) mark
A way of turning a latitude and longitude into a short string or integer cell id where nearby places share a prefix, so a map becomes a grid of named cells. It exists because "drivers within 2 km" is a two-dimensional question that ordinary indexes cannot answer, but "drivers in these nine cells" is a plain key lookup.
Costs
Encode a point: O(precision) · Neighbours of a cell: O(1) · Points in a cell: O(1) + members · Radius query: O(cells × members) · Change precision: O(1)
A tree that splits a rectangle of the map into four equal quadrants, and splits any quadrant that holds too many points again, so dense areas get small cells and empty areas stay as one big cell. It exists because a fixed grid wastes effort where nothing is and overflows where everything is.
Costs
Insert a point: O(depth) · Range query (rectangle): O(depth + k) · k nearest: O(depth + k log k) · Move a point: O(depth) × 2
A small array with one counter per node, attached to every version of a value, that records how many updates each node had seen when it wrote. It exists because wall clocks drift, so the only reliable way to say "this version came after that one" is to count events rather than read a clock.
Costs
Local write: O(1) · Compare two versions: O(N) · Merge on sync: O(N) · Detect conflict: O(N)
A conflict-free replicated data type: a counter, set, map or text document defined so that any two replicas, updated independently, can be merged into the same result no matter the order the updates arrive. It exists so that offline devices and far-apart regions can accept writes without coordination and still converge.
Costs
Local update: O(1) · Merge two replicas: O(state size) · Read the value: O(replicas) for counters · Remove (sets): O(1) + tombstone
A directed acyclic graph: tasks as nodes, "must finish before" as arrows, with no path leading back to where it started. It exists because a pipeline with branches (encode four renditions in parallel, then package) cannot be written as a list, and the graph tells the scheduler exactly what may run now.
Costs
Topological order: O(V + E) · Ready set: O(1) per completion · Critical path: O(V + E) · Retry a task: O(subtree) · Cycle check: O(V + E)