40 40 votes The worst case running times of Insertion sort , Merge sort and Quick sort, respectively are: $\Theta (n \log n)$, $\Theta (n \log n)$ and $\Theta(n^2)$ $\Theta (n^2)$, $\Theta (n^2)$ and $\Theta(n \log n)$ $\Theta (n^2)$, $\Theta (n \log n)$ and $\Theta (n \log n)$ $\Theta (n^2)$, $\Theta (n \log n)$ and $\Theta (n^2)$ Algorithms gatecse-2016-set1 algorithms sorting easy + – Sandeep Singh 17.9k views answer comment Share Follow Print See all 7 Comments 7 7 Comments reply Show 4 previous comments Prince Sindhiya commented Aug 1, 2018 reply Follow flag Yes quick sort is not stable 0 0 replyShare Aakash_ commented Sep 20, 2018 reply Follow flag This Table should not be referenced blindly, it says Randomized Quick Sort take O(nlogn) but it's not True, Worst Case Time is O(n^2) even in Randomized Quick Sort. 4 4 replyShare shashankrustagi commented Feb 7, 2021 reply Follow flag THis table is incorrect BUCKET sort worst case time complexity is $O(n^{2})$ 0 0 replyShare Please log in or register to add a comment.
Best answer 50 50 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 abhilashpanicker29 answered Feb 12, 2016 • edited Jun 24, 2018 by Milicevic3306 abhilashpanicker29 comment Share Follow 0 reply Please log in or register to add a comment.
2 2 votes .Hence the given answer is D varunrajarathnam answered Sep 22, 2020 • edited Sep 27, 2020 by varunrajarathnam varunrajarathnam comment Share Follow 0 reply Please log in or register to add a comment.
2 2 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 himanshu dhawan answered Apr 9, 2021 himanshu dhawan comment Share Follow 0 reply Please log in or register to add a comment.
1 1 vote Insertion Sort: O(n²)-In the worst case (when the array is in reverse order), each element has to be compared with and shifted past all previously sorted elements. This results in about n² comparisons and shifts.Merge Sort: O(n log n)-Merge Sort in all the case takes O(n log n) time.Quick Sort: O(n²)-In the worst case (such as when the pivot is always the smallest or largest element), the array is divided into very unbalanced parts (1 and n−1 elements). This leads to O(n²) comparisons.So the answer is option $(D)$. ahthneeuhl answered Aug 4 ahthneeuhl comment Share Follow 0 reply Please log in or register to add a comment.