1.

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-1This question was addressed to me in class test.Question is from Searching in division Searching of Data Structures & Algorithms II

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.



Discussion

No Comment Found

Related InterviewSolutions