• edited by
2,242 views
1 1 vote

Consider the following program segment:
```
count = 0;
for 1-1 to n
{
M= floor(n/1);
for j-1 to m
count = count + 1;
}
```

The order of magnitude of the program segment is

  1. $\theta(n \log n)$
  2. $O(n)$
  3. $\mathrm{O}(\mathrm{n}$ sqrt(n))
  4. None
    A B C D
    Your answer is incorrect.

    The correct answer is: A

1 Answer

Best answer
4 4 votes

So, option A.

• selected by
Answer:
Position:
Show:

Related questions

0 0 votes
1 1 answer
821
821 views
Beyonder asked Apr 11, 2018
821 views
2. What is asymptotical complexity of the following program: n= readInt()n = readInt()t = ms = 4for (int 1 = 0;105 += =m/= 2n=twriteInt(s) $O\left(n^{2} \times \log _...
0 0 votes
1 1 answer
980
980 views
Parshu gate asked Sep 17, 2017
980 views
What is the time complexity of the following code snippet? int j = 0;For (i=0;i
2 2 votes
1 answers 1 answer
1.6k
1.6k views
gauravkc asked Apr 5, 2018
1,622 views
What is the time complexity of this code?What is the time complexity of the following code?for (int $\mathrm{i}=\mathbf{1} ; \mathrm{i}0 ; \mathrm{h}=\mathrm{h} / 2$ )sum...
3 3 votes
1 1 answer
1.5k
1.5k views
pranab ray asked Jan 15, 2018
1,464 views
Consider the following statements:\[\begin{array}{l}S_{1}: f(n)=\mathrm{O}\left((f(n))^{2}\right) \\S_{2}: \text { If } f(n)=\mathrm{O}(g(n)) \text { then } 2^{f(n)}=\mat...