Back to the 2024 paper

Module 2: Divide and Conquer Paradigm and Heaps

20242m

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 is TRUE?

I. Quicksort runs in Θ(n2)\Theta(n^2) time
II. Bubblesort runs in Θ(n2)\Theta(n^2) time
III. Mergesort runs in Θ(n)\Theta(n) time
IV. Insertion sort runs in Θ(n)\Theta(n) time

  • (i) I and II only
  • (ii) I and III only
  • (iii) II and IV only
  • (iv) I and IV only

Similar questions