1.

What is the time complexity of exponential search when the input array is sorted but the values are not uniformly distributed?(a) O(n^1/2)(b) O(log log n)(c) O(n)(d) O(log n)The question was asked in semester exam.This key question is from Searching topic in portion Searching of Data Structures & Algorithms II

Answer»

The correct choice is (c) O(N)

To explain: When an array has NON uniformly distributed values then in that case the algorithm of INTERPOLATION search fails to work efficiently. As a RESULT, it has a time COMPLEXITY of O(n) in such a case.



Discussion

No Comment Found

Related InterviewSolutions