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

(a) jump search

(b) linear search

(c) binary search

(d) interpolation search

This question was posed to me by my college director while I was bunking the class.

This intriguing question originated from Searching in chapter Searching of Data Structures & Algorithms II

1 Answer

+1 vote
by (614k points)
selected by
Best answer
The correct option is (b) linear search

Best explanation: Out of the given options linear search is the only searching algorithm which can be applied to arrays which are not sorted. It has a time complexity of O(n) in the worst 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.