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;j=2*j)
for(k=1;k<=n;k=k*2)
count++;
Difficulty level
This exercise is mostly suitable for students
O(n*log(n)*log(n))
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Articulation points cut bridges and cut edges