Back to All Algorithms
Ternary Search
Category: Searching | Time: O(log3 n) | Space: O(1)
Visualization
Visual representation of the data structure
Enter an algorithm and input to start visualization.
About Ternary Search

A divide and conquer searching technique. It is similar to binary search but divides the array into three parts and determines which part the key lies in.

Code Editor
The code is for reference. Editing it won't affect the visualization.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Frequently Asked Questions
About Ternary Search