Binary search and Ternary search algorithms are used to search an element in a sorted array. Binary search reduces the array by 1/3 on each iteration whereas Ternary search reduced array size by 1/3 on each iteration.

The Time complexity of Binary Search is **log _{2}(N)**.

The Time complexity of Ternary Search is

**.**

**log**_{3}(N)Ternary search should be faster than the Binary search since **log _{2}(N)** >=

**but this is not the case. When we calculate the Time complexity of any algorithm, we generally ignore the constants. But the constants in Ternary search are relatively larger than Binary search. Due to this, the Ternary search is slower.**

**log**_{3}(N)## Proof

**C _{b} = Number of Comparision in each iteration of Binary Search = 2C_{t} = Number of Comparision in each iteration of Ternary Search = 4**

Substituting **C _{b}** and

**C**in equation 3 and 4, we get

_{t}On Comparing equation 5 and 6,

**Thus, we can say that Binary search is faster than Ternary search.**

This happens because of the increase in the number of comparisons in Ternary search. In simple words, the reduction in the number of iterations in Ternary search is not able to compensate for the increase in comparisons.

Hence, Binary search algorithm is preferred over the Ternary search.

## References

https://en.wikipedia.org/wiki/Binary_search_algorithm