Interpolation search performs better than binary search when?

Thu Ha

New member
Interpolation search performs better than binary search when?
A. array has uniformly distributed values but is not sorted
B. array is sorted and has uniform distribution of values
C. array is sorted but the values are not uniformly distributed
D. array is not sorted
 
Answer: b
Explanation: Interpolation search is an improvement over a binary search for the case when array is sorted and has uniformly distributed values. Binary search performs better when the values are not distributed uniformly.
 

Tìm kiếm

Back
Top