Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Find big O for given logic

Find Big O for the following code:

for (int i=0; i<n; i++)
for (int j = 0; j<n-i; j++) int a=i;
for (int i = 0; i<n; i++) for (int j = 0; j<nnn; j++)
sum++;
by

1 Answer

iamabhishek
Hi, can you please indent the code properly so that it is clear which for loops holds which for loop. Also, is the condition in the 4th loop correct?

Login / Signup to Answer the Question.