retagged by
295 views
0 votes
0 votes

c=0

for i $\leftarrow$ 1 to n

   for j $\leftarrow$ i+1 to n

       for k $\leftarrow$ 1 to j

            c = c + 1 

 

The value of c is

  1. O(n$^{2}$)
  2. O(n$^{2}$.log n)
  3. O(n$^{3}$)
  4. O(n$^{3}$.log n)
retagged by

1 Answer

Related questions

3 votes
3 votes
1 answer
1
Daniyal89 asked Oct 8, 2018
956 views
ans given is option A
0 votes
0 votes
0 answers
2
Neelu Lalchandani asked Nov 2, 2022
325 views
Time Complexity in C will be O(n) right? and big omega (n) is also big omega (n^2), then why is c incorrect?
0 votes
0 votes
1 answer
3
0 votes
0 votes
1 answer
4