Galloping Intersection Search
Find intersection of two sorted sequences using exponential jumps followed by binary search.
132 notes
Find intersection of two sorted sequences using exponential jumps followed by binary search.
Use interpolation to estimate the target position, with binary search fallback when estimates become unreliable.
Search several array elements at once using vector instructions.
Arrange and search sorted data with explicit knowledge of cache lines or memory blocks.
Search a binary tree stored in recursive cache oblivious layout to reduce memory transfers.
Binary search over an array arranged in heap order to improve cache locality and branch predictability.
Perform binary search with conditional moves or arithmetic updates instead of unpredictable branches.
Use a hierarchy of learned models to predict a key position, then search inside a bounded error range.
Answer offline connectivity queries by combining parallel binary search with a disjoint set union.
Convert an optimization problem into a decision problem and search the parameter space.
Cache-efficient and hardware-tuned search: branchless binary search, Eytzinger and vEB layouts, learned indexes, SIMD search, and galloping intersection.
Tree-based and indexed search: BST, self-balancing trees, tries, suffix structures, segment and range trees, and spatial trees.
Hash table lookup strategies, open-addressing and chaining variants, probabilistic filters (Bloom, Cuckoo, XOR), and locality-sensitive similarity search.
Binary search and its ordered-search relatives: interpolation, Fibonacci, rotated-array, matrix, parametric, and offline variants.
Linear and sequential scan techniques including sentinel, bounded, recursive variants, duplicate detection, and majority vote.
Searching and sorting techniques spanning sequential and parallel algorithms, from linear scan to GPU-based distribution sort.
Expand the search range exponentially until the target is bracketed, then refine within the range.
Find diagonal partition points that split a sorted merge into independent balanced ranges.
Use vector instructions to evaluate multiple candidate positions in a binary search step.
Compute lower bound using arithmetic or conditional moves instead of branches.
Use a predictive model to estimate where a key should appear, then search within a bounded local range.
Estimate the likely position using interpolation, then refine by local sequential scan.
Search starting from a known nearby position, achieving time proportional to distance rather than full size.
Search for points or regions in 3D space using recursive octant decomposition.
Search for points or regions in 2D space using recursive quadrant decomposition.
Search for spatial objects using hierarchical minimum bounding rectangles.
Nearest neighbor search in metric space using hierarchical covers with exponential scale separation.
Nearest neighbor search in metric space using vantage point partitioning.
Search for nearest neighbors in metric space using hierarchical clustering with hyperspheres.
Search for nearest or range points in k-dimensional space using recursive axis splitting.
Search for all points within a multidimensional range using layered balanced search trees.
Search for all intervals that overlap a query interval using a balanced interval tree.
Search for a pattern in a suffix array using LCP information to reduce redundant character comparisons.
Search for a pattern in a text by binary searching the lexicographically sorted suffix array.
Search for a pattern in a text using a suffix tree in time proportional to the pattern length.
Search for a string key in a ternary search tree using character comparisons and three-way branching.
Search for a key in a Patricia trie using bitwise branching with path compression.
Search for a string or byte key in a radix tree using variable length edge labels.
Search for a string key in a trie whose unary paths are compressed into edge labels.
Search for a string key in a prefix tree by following character transitions.
Search for an integer key using a Y fast trie, combining hashing with balanced trees for linear space.
Search for an integer key in an X fast trie using hashed prefixes over a binary trie.
Search for an integer key in a van Emde Boas tree using recursive universe decomposition.
Search in a B* tree, a B tree variant that keeps nodes denser by redistributing entries before splitting.
Search in a B+ tree where all records are stored in leaves and internal nodes guide traversal.
Search for a key in a multiway balanced search tree optimized for block based storage.
Search in a binary search tree that keeps subtree sizes balanced to guarantee logarithmic height.
Search in a weight balanced binary search tree that rebuilds subtrees to preserve logarithmic height.
Search in a self-adjusting binary search tree that moves accessed nodes toward the root.
Search for a key in a binary search tree by exploiting ordering between nodes.
Search in a binary search tree maintained with randomization to achieve expected logarithmic height.
Search in a randomized binary search tree that also maintains heap order over priorities.
Search in a balanced binary search tree with relaxed balancing using color properties.
Search in a height balanced binary search tree with guaranteed logarithmic depth.
Search a sorted array by repeatedly halving the search interval.
Find the largest index at which a target value appears in a sequence.
Find the smallest index at which a target value appears in a sequence.
Linear search expressed recursively by reducing the problem size one element at a time.
Retrieve rows by probing a hash-based index structure using an exact key match.
Find matching records during a join by probing a hash table built from one relation.
Search for a pattern in text by comparing rolling hash values before verifying matching windows.
Resolve hash collisions by storing multiple elements in buckets using linked structures.
Retrieve a value by computing a hash and probing a table for the corresponding key.
Linear search restricted to a specified index range within a sequence.
Scan a sequence from right to left to find the last occurrence of a target value.
Linear search optimized by placing a sentinel value to eliminate boundary checks inside the loop.
Scan a sequence from left to right until the target value is found or the sequence ends.
Search for a pattern in a sequence by maintaining a hash over a sliding window.
Estimate set similarity and find similar items using compact MinHash signatures and banding.
Find near duplicate documents by comparing compact SimHash fingerprints under Hamming distance.
Search for approximate nearest neighbors by hashing similar items into the same buckets with high probability.
Map a key to the node that receives the highest hash score for that key.
Map a key to a node by placing both on a hash ring and selecting the next node clockwise.
Test approximate membership using a compact XOR-based filter with improved construction and cache locality.
Test approximate membership with a static fingerprint filter built from three hash locations and XOR constraints.
Test approximate membership by storing compact fingerprints in cuckoo hash table buckets.
Test approximate membership by splitting a hash fingerprint into quotient and remainder fields.
Test membership with a Bloom filter variant that supports deletions using small counters instead of bits.
Test set membership with a compact probabilistic bit array that allows false positives but no false negatives.
Look up a key using a collision free hash function that maps a static key set to exactly n table positions.
Look up a key in a static hash table whose hash function has no collisions for the stored key set.
Search in an open addressing hash table that keeps probe distances balanced across keys.
Search in a hash table that maintains elements within a small neighborhood of their home bucket.
Look up a key in a cuckoo hash table by checking a small fixed set of candidate positions.
Resolve hash collisions using a second hash function to define probe steps.
Resolve hash collisions by probing with quadratic offsets to reduce clustering.
Resolve hash collisions by scanning sequential slots until the key is found or an empty slot appears.
Find the last position where a monotone predicate remains true.
Find the range of indices containing all occurrences of a value in a sorted array.
Find the first index where elements become strictly greater than a given value.
Compute the floor of the square root of a nonnegative integer using binary search.
Find the boundary where a Boolean predicate changes value over an ordered domain.
Find a root of a continuous function by repeatedly halving an interval where the function changes sign.
Answer many monotone queries by processing them together after all input is known.
Answer many offline queries by searching their answers simultaneously with shared checks.
Search for a boundary by trying decreasing jumps whose lengths are powers of two.
Find a target state by jumping through powers of two in a precomputed lifting table.
Speed up repeated binary searches across related sorted lists by linking sampled elements between lists.
Search a matrix sorted by rows and columns using divide and conquer.
Search a matrix sorted by rows and columns using a monotone path from a corner.
Search a row-major sorted matrix by treating it as a virtual sorted array.
Find a peak element in a 2D grid using divide and conquer.
Find an element that is at least as large as its immediate neighbors.
Search a value in an array that first increases and then decreases.
Find the smallest element in a sorted array that has been rotated around an unknown pivot.
Search a value in a sorted array that has been rotated around an unknown pivot.
Find the maximum or minimum of a unimodal function over a continuous domain.
Find the maximum or minimum of a unimodal function defined on discrete indices.
Search a sorted array by jumping in fixed steps, then performing a linear scan within a block.
Search a sorted array using Fibonacci numbers to divide the range.
Binary search variant that uses precomputed step sizes instead of dynamic midpoint calculation.
Search a sorted numeric array by estimating the likely position of the target from its value.
Expand the search range exponentially from a starting position, then apply binary search.
Locate a search interval by exponential growth, then apply binary search.
Find an optimal value by binary searching a monotone feasibility condition.
Find the first position where a monotone predicate becomes true.
Find the first position where a value can be inserted without violating sorted order.
Binary search implemented using recursion over a shrinking interval.
Binary search implemented using a loop without recursion.
Check whether a value exists in an unsorted sequence.
Find an index where an element is smaller than its neighbors using a linear scan.
Find the second largest element in a sequence.
Find the second smallest element in a sequence.
Find a majority element in linear time using cancellation.
Find a candidate element that may appear more than half the time using a linear scan.
Count the number of occurrences of a target value in a sequence.
Detect whether a sequence contains duplicate elements using a direct scan.
Find both minimum and maximum with fewer comparisons by processing elements in pairs.
Find both the minimum and maximum elements in a sequence using a single pass.
Find the index of the maximum element in an unsorted sequence.
Find the index of the minimum element in an unsorted sequence.
Find all indices where a target value appears in a sequence.