+1 vote
in Data Structures & Algorithms II by (110k points)
In which of the following case jump search performs better than interpolation search?

(a) When array has uniformly distributed values but is not sorted

(b) when array is sorted and has uniform distribution of values

(c) when array is sorted but the values increases exponentially

(d) when array is not sorted

I have been asked this question in homework.

My question is based upon Searching in section Searching of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
 
Best answer
Correct option is (c) when array is sorted but the values increases exponentially

The explanation is: In case of non uniform distribution of values the time complexity of interpolation search is O(n) whereas the average time complexity of jump search is O(n^1/2). So in such a case jump search has a better performance.

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

...