Question discussion

Which of the following sorting algorithms needs only O(1) extra (auxiliary) space?

2329Medium DSSSB TGT Computer Science 0 replies 1 views
0

Which of the following sorting algorithms needs only O(1) extra (auxiliary) space?

  • ABucket sort
  • BMerge sort (array version)
  • CCounting sort
  • DHeap sort
Correct answer: D

Explanation

Heap sort rearranges the elements inside the array itself, while merge sort, counting sort and bucket sort need an additional array of size O(n) or more.

Discussion 0

Nobody has replied yet. Start the discussion!