1.

Which of the following searching algorithm is fastest when the input array is sorted but has non uniformly distributed values?(a) jump search(b) linear search(c) binary search(d) interpolation searchA simple yet interesting question from data structure and algorithms.

Answer» CORRECT option is (C) binary search

Easy explanation - INTERPOLATION search has a time complexity of O(n) when the array does not have UNIFORMLY distributed values. So in such a CASE binary search has the least time complexity out of the given options.


Discussion

No Comment Found

Related InterviewSolutions