Which of the below statements are not true about heap sort?
i. heap sort is a selection sort with heap.
ii. time complexity of heap sort is O(n log n)
iii. heap sort will take O(n) time to remove element from heap and insert to the array in sorted order.
iv. heap sort is good for sorting arrays, compared to linked lists.
Heap sort will take only O(log n) time to remove element from heap, and to insert into array. this will repeat for n no of items. so its time complexity is O(n log n). Heap sort is same as selection sort, only difference is we use here heap to store initial elements. Time complexity of heap sort is O(n long n), and it can applicable efficiently on arrays compared to linked lists.
Back To Top