Overview
Ternary Search repeatedly removes one third of a range when a function rises then falls, or falls then rises.
Finds an optimum in a unimodal range by comparing two interior points.
Compact metadata for implementation and discovery.
Ternary Search repeatedly removes one third of a range when a function rises then falls, or falls then rises.
Quick facts
Runtime and memory behavior at a glance.
Best
O(log n)
Average
O(log n)
Worst
O(log n)
Space
O(1)
m1 = low + (high - low) / 3; m2 = high - (high - low) / 3Splits a unimodal search interval into thirds.
Show an interval shrinking around a single peak or valley.
Ternary Search operates in O(log n) time and O(1) space within the Interval Search family. Key governing relation: m1 = low + (high - low) / 3; m2 = high - (high - low) / 3. Often compared with Binary Search and Bisection Method.
What each reference supports for this entry.
Searching reference for Ternary Search's probe strategy, comparison model, and expected or worst-case behavior.
Good next jumps from the relationship graph, ranked for useful discovery.
Ternary search and binary search both narrow ordered domains under different objective assumptions.