Which of the following sorting algorithms has the worst time complexity of nlog(n)?
Show answerHide answer
Correct answer: (A) Heapsort
Explanation
Heapsort is O(n log n) even in the worst case. Quicksort's worst case is O(n²), and insertion and selection sort are O(n²).