Which of the following searching algorithm is fastest when the input array is not sorted but has uniformly distributed values?

Duyên Trương

New member
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
 
Answer: b
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.
 

Tìm kiếm

Back
Top