+1 vote
in Data Structures & Algorithms II by (110k points)
What will be the maximum number of comparisons that can be made in jump search algorithm (assuming k to be blocks jumped)?

(a) k

(b) n/k

(c) k-1

(d) k-1

This question was addressed to me in class test.

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

1 Answer

+1 vote
by (614k points)
selected by
Best answer
Right choice is (c) k-1

Explanation: Worst case occurs when the element being searched is present just after the element that has been compared while making the last jump. So, in this case k-1 comparisons will have to be made.

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.