1.

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 searchThis 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

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.



Discussion

No Comment Found

Related InterviewSolutions