All mock tests are FREE till 31 December — register to save your progress

There are many sorting algorithms based on comparison. The running time of heapsort O(n lg n) P Q algorithm is . Like , but unlike , (P, Q) heapsort sorts in place where is equal to

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. Insertion sort, Merge sort

Explanation

Heapsort sorts in place like insertion sort, unlike merge sort, which needs extra memory.

More Data Structures and Algorithms questions