GATE CS 2016 · Set-2 · Insertion Sort

MCQ · 1 mark · Problem PROG-SORT-0028

Assume that the algorithms considered here sort the input sequences in ascending order. If the input is already in ascending order, which of the following are TRUE? I. Quicksort runs in \(\Theta (n^{2})\) time II. Bubblesort runs in \(\Theta (n^{2})\) time III. Merge sort runs in \(\Theta (n)\) time IV. Insertion sort runs in \(\Theta (n)\) time
  1. A
    I and II only
  2. B
    I and III only
  3. C
    II and IV only
  4. D
    I and IV only

Solve it on GATE DA practice →More Searching & Sorting Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option D.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/39561/gate2016-2-13

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com