Question:

Consider following statements about time complexity :
A. Merge sort and heap sort have $O(n \log n)$ in worst case

B. Quick sort has $O(n \log n)$ in average case and $O(n^2)$ in worst case

C. Insertion sort is faster than merge sort for large $n$

D. Bubble sort is stable

E. Selection sort has fewer swap than insertion sort

Choose the correct answer from the options given below :

Show Hint

Selection sort is the best choice when the cost of "swapping" memory is very high, because it minimizes the total number of swaps.
Updated On: Aug 6, 2026
  • B, C, E only
  • A, C, D only
  • A, B, C only
  • A, B, D, E only
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation

Concept:
• Algorithm analysis involves evaluating the performance (Time and Space complexity) of different sorting methods under various conditions (Worst, Average, and Best case).

Step 1:
Evaluate log-linear sorts (A and B)
Merge sort and Heap sort both use a divide-and-conquer strategy (logarithmic levels) and process every element (linear work), leading to a guaranteed \(O(n \log n)\) complexity in all cases. Quick sort is also \(O(n \log n)\) on average but degrades to \(O(n^2)\) if the pivot choices are poor (e.g., sorted arrays). Statements A and B are Correct.

Step 2:
Evaluate relative performance (C)
For large \(n\), an \(O(n \log n)\) algorithm (Merge sort) will always eventually be faster than an \(O(n^2)\) algorithm (Insertion sort). Insertion sort is only faster for very small arrays. Statement C is Incorrect.

Step 3:
Evaluate Stability (D)
A sorting algorithm is stable if it preserves the relative order of elements with equal keys. Bubble sort only swaps adjacent elements if they are strictly out of order, making it stable. Statement D is Correct.

Step 4:
Evaluate Swap efficiency (E)
Selection sort finds the minimum in each pass and performs exactly one swap. Insertion sort may perform up to \(O(n)\) swaps (or rather, shifts) for a single element to reach its destination. In terms of memory writes/swaps, Selection sort is superior. Statement E is Correct.
Was this answer helpful?
0
0

Top CUET PG Data Science A.I Cyber Security and Computer Sci. Questions

View More Questions

Top CUET PG Algorithm Questions

View More Questions