Question 17406 – ISRO CS-2023
February 7, 2024Question 17409 – ISRO CS-2023
February 7, 2024Question 17407 – ISRO CS-2023
Worst case time complexity of heap sort for n elements
Correct Answer: A
Question 6 Explanation:
Heap Sort has a time complexity of O(n log n) in the worst case because it builds a max-heap or min-heap (depending on whether it’s sorting in ascending or descending order) and performs n iterations (heapify) for n elements.
Each heapify operation takes O(log n) time in the worst case.
Each heapify operation takes O(log n) time in the worst case.
O(nlogn)
O(logn)
O(n2)
O(n)
Subscribe
Login
0 Comments