Exponential search locates a target's possible range in a sorted sequence by probing indices until the target is bounded above or the sequence ends, then uses binary search inside the final bracket. If the target lies near index , this takes probes under random-access and constant-comparison assumptions. For an unbounded monotone predicate, the same method brackets the first true index. It is useful when the relevant prefix is much shorter than the whole sequence or its length is not initially known. Finite sequences still require bounds checks at each probe.
To discover a positive unknown integer by comparisons, test the thresholds for fixed . If the first threshold not smaller than has index , fewer than candidates remain and binary search needs at most comparisons. Since , the total is at most . Choosing makes the leading constant at most ; the additive constant may depend on .
Exponential sign bracketing finds an integer interval with opposite endpoint signs before sign-bracketing binary search. Suppose is defined on nonnegative integers, its signs can be evaluated exactly, , and for all sufficiently large integers . Test . An exact zero can be returned immediately; otherwise stop at the first positive endpoint and retain the preceding negative endpoint, or zero when .
Excluding the already known evaluation at zero, this takes endpoint tests. For , the final integer interval is , of width . Repeated midpoint tests preserving opposite endpoint signs take further tests to reach adjacent integers, unless an exact zero is found earlier. For , is already adjacent.
No monotonicity is needed to preserve opposite endpoint signs, though other crossings may be skipped. Adjacent opposite signs do not imply an integer root; for , neither endpoint of is a root. A real-valued extension requires continuity to infer a real root by the intermediate value theorem. A machine implementation must handle integer overflow and unreliable floating-point arithmetic; mathematical termination does not ensure representable endpoints.

Articles by others on the same topic (1)

Exponential search is a searching algorithm that is used to find the position of a target value in a sorted array. It combines two techniques: binary search and an exponential range finding strategy. Exponential search is particularly useful for unbounded or infinite-sized search spaces, although it can also be applied to finite-sized arrays. ### Steps of Exponential Search: 1. **Check the First Element**: Start by comparing the target value with the first element of the array.