Fibonacci Search locates a value in a sorted, random-access array without repeatedly dividing the search interval. It keeps three consecutive Fibonacci numbers large enough to cover the candidate range and probes at offset + F(k-2).

Every possible target index stays greater than offset and inside the current Fibonacci window. A value below the target advances the offset. A value above it keeps the offset and contracts the window to its left component. Like Binary Search, the algorithm repeatedly discards part of the candidate range. Its distinction is the Fibonacci offset arithmetic.

Visualization

The trace grows a Fibonacci window that covers the nine values, then probes from an offset initially set before index 0. Each comparison either advances the offset past a proven-small prefix or contracts the live range to the smaller Fibonacci component. A final one-element check handles the remaining candidate after the main window reaches size one.

Complexity
n
number of elements in the sorted array

Boundaries

The array must be sorted under the same comparison used by the search. Otherwise, neither discarded side is proven irrelevant. Random access is required as well because the algorithm jumps to computed indices. A forward-only stream cannot do that.

Duplicates are safe, though the returned match is arbitrary. A lower-bound or upper-bound Binary Search is clearer when the first or last duplicate matters. The covering Fibonacci number should use a wider integer type so it cannot overflow near the maximum array length.

References