retagged by
15,471 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.
retagged by

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
Merge sort -O(nlogn)
Answer:

Related questions

1 votes
1 votes
2 answers
1
admin asked Mar 31, 2020
1,400 views
Time complexity of an algorithm $T(n)$, where $n$ is the input size is given by$\begin{array}{ll}T(n) & =T(n-1)+\frac{1}{n}, \text{ if }n>1\\ & =1, \text{ otherwise} \en...
0 votes
0 votes
2 answers
2
admin asked Mar 31, 2020
1,282 views
A hash function $f$ defined as $f(\text{key})=\text{key mod }7$, with linear probing, insert the keys $37,38,72,48,98,11,56$ into a table indexed from $11$ will be stored...
2 votes
2 votes
3 answers
3
admin asked Mar 31, 2020
1,323 views
A hash table has space for $100$ records. Then the probability of collision before the table is $10\%$ full, is$0.45$$0.5$$0.3$$0.34$ (approximately)
3 votes
3 votes
2 answers
4
admin asked Mar 31, 2020
6,464 views
If $A$ and $B$ are square matrices of size $n\times n$, then which of the following statements is not true?$\det(AB)=\det(A) \det(B)$$\det(kA)=k^n \det(A)$$\det(A+B)=\det...