1.

The complexity of which of the following sorting algorithms remains to be the same in its best, average and worst case?(a) quick sort(b) insertion sort(c) counting sort(d) gnome sortThe question was asked in an online interview.Origin of the question is Sorting in division Sorting of Data Structures & Algorithms II

Answer»

The correct option is (c) COUNTING SORT

The best I can EXPLAIN: The time complexity of counting sort remains unvaried in all the THREE cases. It is GIVEN by O(n+k).



Discussion

No Comment Found

Related InterviewSolutions