What is the time complexity of Fibonacci Search?

What is the time complexity of Fibonacci Search?
A. O(logn)
B. O(n)
C. O(n$^{2}$)
D. O(nlogn)
 
Answer: A
Explanation: Since it divides the array into two parts, although not equal, its time complexity is O(logn), it is better than binary search in case of large arrays.
 

Tìm kiếm

Back
Top