1.

What is the worst case time complexity of LSD radix sort?(a) O(nlogn)(b) O(wn)(c) O(n)(d) O(n + w)I got this question in a job interview.Query is from Sorting topic in chapter Sorting of Data Structures & Algorithms II

Answer»

Right choice is (b) O(wn)

Easiest explanation - Time COMPLEXITY of LSD radix sort DEPENDS UPON the word SIZE and the number on items. It runs in O(wn) time in worst case, where n is the number of inputted elements and W is the number of digits in the largest number.



Discussion

No Comment Found

Related InterviewSolutions