What is the running time of the following piece of code ?

for(i=1;i<=n;i++)
{
     j=1;
     while(j<=n)
         j=j*2;
}


Difficulty level
This exercise is mostly suitable for students
n*log(n)

Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Duplicate elements in an array