What is the time complexity of interpolation search when the input array has uniformly distributed values and is sorted?

Linh Chi

New member
What is the time complexity of interpolation search when the input array has uniformly distributed values and is sorted?
A. O(n)
B. O(log log n)
C. O(n log n)
D. O(log n)
 
Answer: b
Explanation: Interpolation search goes to different positions in the array depending on the value being searched. It is an improvement over binary search and has a time complexity of O(log log n).
 

Tìm kiếm

Back
Top