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 ?
Answer: C. Merge sort — 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…
- A.
Insertion sort
- B.
Quick sort
- C.
Merge sort
- D.
Selection sort
Attempted by 602 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: Iocl Engineers Officers Grade A Paper 2
Loading lesson…