GATE / CS ARCHIVE

GATE CSE 2007 / QUESTION 14

Lowest worst-case sorting complexity

Algorithms · Searching, Sorting & Selection · Full GATE CSE 2007 paper

GATE 2007, Q14 1 mark · MCQ
Report issue

Searching, Sorting & Selection

Question 14, GATE 2007: Which listed sorting algorithm has the lowest worst-case time complexity?
Options:
(A) Merge sort
(B) Bubble sort
(C) Quick sort
(D) Selection sort
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. Approach. Compare guaranteed worst-case bounds, not average performance. Mergesort halves the input and performs linear merging on each recursion level.

2. Derivation and interpretation. Standard mergesort guarantees Θ(n log n) worst-case time. Bubble sort, selection sort and conventional quicksort can take Θ(n²) in the worst case. Hence mergesort, A.

Original paper, page 3