What is the running time of the following piece of code ?
int i,j,k, count =0;
for(i=n/2;i<=n;i++)
for(j=1;j+n/2<=n;j=j++)
for(k=1;k<=n;k=k*2)
count++;
Difficulty level
This exercise is mostly suitable for students
O(n*n*log(n))
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Complexity of sum of square root