1.

What is the best time complexity of bucket sort (k= number of buckets)?(a) O(n + k)(b) O(n.k)(c) O(n^2)(d) O(n log n)I had been asked this question during an online exam.This key question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II

Answer»

Correct answer is (a) O(n + K)

The BEST explanation: Time complexity of bucket sort is O(n+k). It performs BETTER than any comparison BASED sort if there is a uniform input distribution.



Discussion

No Comment Found

Related InterviewSolutions