Which of the following sorting algorithms has the worst-time complexity of n(…

2018

Which of the following sorting algorithms has the worst-time complexity of n( log n)?

  1. A.

    Heapsort

  2. B.

    Quicksort

  3. C.

    Insertion sort

  4. D.

    Selection sort

Attempted by 659 students.

Show answer & explanation

Correct answer: A

Heapsort has worst-case time complexity = O(n log n). Quicksort’s worst case is O(n²), while Insertion and Selection sorts are O(n²)

Explore the full course: Up Lt Grade Assistant Teacher 2025