Comparison with Binary Search
In binary search, the search space is halved with each comparison, making it very efficient with a time complexity of O(log2n). On the other hand, ternary search divides the search space into three parts, reducing it by a smaller fraction each time. This leads to slower convergence compared to binary search.
Why ternary search is not efficient?
When it comes to searching algorithms, ternary search is a technique that divides the search space into three parts instead of two like in binary search.
Below are the reasons why ternary search is not considered efficient in certain scenarios.