edited by
12,838 views
25 votes
25 votes

The worst case running times of Insertion sort , Merge sort and Quick sort, respectively are:

  1. $\Theta (n \log n)$, $\Theta (n \log n)$ and $\Theta(n^2)$
  2. $\Theta (n^2)$, $\Theta (n^2)$ and $\Theta(n \log n)$
  3. $\Theta (n^2)$, $\Theta (n \log n)$ and $\Theta (n \log n)$
  4. $\Theta (n^2)$, $\Theta (n \log n)$ and $\Theta (n^2)$
edited by

3 Answers

Best answer
35 votes
35 votes

Answer is D.

Insertion sort:  $=  \Theta(n^2)$

Merge sort:      $=  \Theta(n\log n)$

Quick sort:       $=  \Theta (n^2)$

Note : here $\Theta$ is not average case since question asked worst case so $\Theta$ represent worst case only

edited by
0 votes
0 votes
Insertion Sort Worst-Case time complexity=O(n^2)

Merge Sort Worst-Case time complexity=O(nlogn)

Quick Sort Worst-Case time complexity=O(n^2)

Option D is correct
Answer:

Related questions