+1 vote
in Data Structures & Algorithms II by (110k points)
Which of the following searching algorithm is fastest when the input array is sorted and has uniformly distributed values?

(a) jump search

(b) exponential search

(c) binary search

(d) interpolation search

This question was addressed to me in an interview.

Question is taken from Searching topic in division Searching of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
 
Best answer
Right choice is (d) interpolation search

Easy explanation - Interpolation search has a time complexity of O( log log n) when the array is sorted and has uniformly distributed values. It has the least time complexity out of the given options for such a case.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...