Question 12Asked in UGC NET Computer Science, June 2015 (Paper II & III, Selected Questions)

Which of the following algorithms sort n integers, having the range 0 to (n² – 1), in ascending order in O(n) time?

  1. ASelection sort
  2. BBubble sort
  3. CRadix sort
  4. DInsertion sort
Show answerHide answer

Correct answer: (C) Radix sort

Explanation

Radix sort because it sorts in integers in range 0 … (n² – 1) in O(n) time using base-n representation.

From UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions)

This is question 12 of UGC NET Computer Science PYQ, June 2015 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.