Assume that the algorithms considered here sort the input sequences in…

PYQ GATE 2016

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 Θ(n2)Θ(n^2) time

II. Bubblesort runs in Θ(n2)Θ(n^2) time

III. Mergesort runs in Θ(n)Θ(n) time

IV. Insertion sort runs in Θ(n)Θ(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

Attempted by 553 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…