Of the following sort algorithms, which has execution time that is least…

2020

Of the following sort algorithms, which has execution time that is least dependent on initial ordering of the input ?

  1. A.

    Insertion sort

  2. B.

    Quick sort

  3. C.

    Merge sort

  4. D.

    Selection sort

Attempted by 302 students.

Show answer & explanation

Correct answer: C

Merge Sort consistently runs in O(n log n) time regardless of input order. Other algorithms like Quick Sort or Insertion Sort may degrade to O(n^2) based on initial data arrangement. Thus, Merge Sort is the least dependent on input ordering.

Explore the full course: Isro