ISRO | ISRO CS 2020 | Question 21

What is the complexity of the following code ?

sum = 0;
  for (i = 1; i <= n; i*= 2)
    for(j = 1; j <= n; j++)
      sum++; 

Which of the following is not a valid string ?
(A) Ο(n2)
(B) Ο(n log n)
(C) Ο(n)
(D) Ο(n log n log n)


Answer: (C)

Explanation:

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.