1,752 views
1 votes
1 votes

$\sum(range -> 1<=k<=n) O(n)$, where O(n) stands for order n is -

a) O(n)                b)   O(n2)

c)  O(m3)       d) O(3n2)

1 Answer

2 votes
2 votes

Yes,'K' is used as follows:

1<= k<= n => we have add O(n) 'n' times since 'k' is 1 to n. 'K' is like iterator .

Hence : O(n) +O(n) +O(n) +...........n times  =  nO(n) = O(n2)

Hence ans: (b)

Answer:

Related questions

295
views
0 answers
0 votes
usdid asked Apr 16, 2022
295 views
a) what is the iterative equation showing the running time of the algorithm whose pseudocode is given below? b) What is this repeated equation in asymptotic notation using the Master' ... 0 for i=1 ton do total = total + i*i print total
348
views
1 answers
0 votes
piyushkr asked Dec 31, 2015
348 views
n^(1/(2^(log2log2n)))
504
views
1 answers
2 votes
1.7k
views
4 answers
0 votes
piyushkr asked Jan 21, 2016
1,665 views
Up(Semaphore S) { if (Suspended list() is empty) S.value=1; else { Select a process from the suspended list and WakeUp() } }