in Others edited by
543 views
1 vote
1 vote

$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$
in Others edited by
543 views

1 comment

Answer:B
0
0

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