What is the difference between ternary search and Fibonacci search?

Searching Algorithms Questions



24 Short 58 Medium 71 Long Answer Questions Question Index

What is the difference between ternary search and Fibonacci search?

The main difference between ternary search and Fibonacci search lies in their approach and the way they divide the search space.

Ternary search is a divide and conquer algorithm that repeatedly divides the search space into three equal parts. It compares the target value with the values at two points in the search space to determine which part of the space to continue searching in. This process continues until the target value is found or the search space is exhausted.

On the other hand, Fibonacci search is a more efficient algorithm that uses Fibonacci numbers to divide the search space. It divides the search space into two parts using the Fibonacci numbers to determine the dividing point. It compares the target value with the value at the dividing point and adjusts the search space accordingly. This process continues until the target value is found or the search space is exhausted.

In summary, the main difference between ternary search and Fibonacci search is the way they divide the search space. Ternary search divides the space into three equal parts, while Fibonacci search uses Fibonacci numbers to divide the space into two parts.