Multiple choice

Which of the following statements is/are true?

  1. Quick sort algorithm and bubble sort algorithm takes O(n2) in worst case.
  2. Quick sort and merge sort takes O(n2) in worst case.

  1. Only 1

  2. Only 2

  3. Both 1 and 2

  4. Neither 1 or 2

  5. None of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

yes quick sort in worst case behaves as bubble sort whose time complexity is O(n2)

merge sort even in the worst case has time complexity of O(nlog n), so statement 2 is false