Which of the following statements is not true about comparison-based sorting…

2024

Which of the following statements is not true about comparison-based sorting algorithms?

  1. A.

    The minimum possible time complexity of a comparison-based sorting algorithm is O (n*Logn) for a random input array.

  2. B.

    Any comparison-based sorting algorithm can be made stable by using position as a parameter when two elements are compared

  3. C.

    The Counting sort is not a sorting algorithm based on comparison

  4. D.

    Heap Sort is not a comparison-based sorting algorithm.

Attempted by 72 students.

Show answer & explanation

Correct answer: D

Heap sort is a comparison-based sorting technique that relies on the binary heap data structure. It is similar to selection sort where we first find the maximum element and place the maximum element at the end. We repeat the same process for the rest.

Explore the full course: Coding For Placement