1.

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 sortedThis is one of most asked question in data structure and algorithms interview.

Answer»

Right option is (B) ARRAY is sorted and has uniform distribution of values

For 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.



Discussion

No Comment Found

Related InterviewSolutions