+1 vote
in Data Structures & Algorithms II by (110k points)
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)

I had been asked this question in an international level competition.

I'm obligated to ask this question of Searching topic in chapter Searching of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
The correct option is (b) O(log log n)

Easy 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).

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.