edited by
558 views
1 votes
1 votes

$100$ elements can be sorted in $100 \; \text{sec}$ using bubble sort. In $400 \; \text{sec},$ approximately ____________ elements can be sorted.

  1. $100$
  2. $200$
  3. $300$
  4. $400$
edited by

1 Answer

3 votes
3 votes
time complexity of bubble sort ,T(n)=O(n^2).

T(n)<=cn^2

100<=c* 100*100

c>=1/100

now it is given T(n)=400,

400<=c*n^2

400<=1/100*n^2

400*100<=n^2

200<=n

so ans is B.

Related questions

0 votes
0 votes
1 answer
1
soujanyareddy13 asked Dec 7, 2021
926 views
Write Recurrence of Quick Sort in worst case.$ \text{T(n)} = \text{T (n-1)} + 1 $$ \text{T(n)} = \text{T (n-1) + n} $$ \text{T(n)} = 2 \text{T (n-1) + n} $$ \text{T(n)} =...
0 votes
0 votes
0 answers
2
soujanyareddy13 asked Dec 7, 2021
535 views
$y = 10 \cos (1800 \; \pi t) + 20 \cos (2000 \; \pi t) + 10 \cos (220 \; \pi t).$ Find the modulation index $(\mu)$ of the given wave. $0.3$$0.5$$0.7$$1$
0 votes
0 votes
1 answer
3
soujanyareddy13 asked Dec 7, 2021
589 views
Match the following:$$\begin{array} {llll} & \textbf{List-I} & & \textbf{List-II} \\ \text{W.} & \text{Condition coverage} & 1. & \text{Black-box testing} \\ \text{X.} ...
0 votes
0 votes
2 answers
4
soujanyareddy13 asked Dec 7, 2021
3,260 views
_________ is the class of decision problems that can be solved by non-deterministic polynomial algorithms.$\text{NP}$$\text{P}$HardComplete