in Algorithms retagged by
15,449 views
4 votes
4 votes

Which of the following sorting algorithms does not have a worst case running time of $O(n​^2​)$?

  1. Insertion sort.
  2. Merge sort.
  3. Quick sort.
  4. Bubble sort.
in Algorithms retagged by
by
15.4k views

1 comment

Merge sort.
1
1

11 Answers

2 votes
2 votes
Merge sort - nlogn

Quick sort - n*n

Bubble sort - n*n

insertion sort - n*n

Answer is merge sort
0 votes
0 votes
option B will be the correct option

merge sort - O(nlogn)

insertion sort - O(n^2)

quick sort - O(n^2)

bubble sort - O(n^2)

These all are worst case time complexities of these algorithms
0 votes
0 votes
Yes..Merge sort has the time complexity of O ( n log n). Hence option B is correct.
0 votes
0 votes
Merge sort -O(nlogn)

1 comment

Yes it's merge sort with Tc  o(nlogn) rest of them have time complexity as o(n^2).
0
0
Answer:

Related questions