-4

Heap sort may be considered as

A. Insertion sort done on a heap data structure instead of a list.
B. Selection sort done on a heap data structure instead of a list.
C. Bubble sort done on a heap data structure instead of a list.
D. None of the above.
Jim Mischel
  • 131,090
  • 20
  • 188
  • 351

1 Answers1

0

The answer should be B.

As when doing the min or max heapify during Heap Sort we retrieve the min or max element respectively from the whole heap and place it on the root of the heap.

Selection Sort does the same thing. Finding min/max element from the array and place it at arr[0]. Then again find min/max element from the rest of the array and place it at arr[1] and so on.

FallAndLearn
  • 4,035
  • 1
  • 18
  • 24