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

int i, count =0;
for(i=1;i*i<=n;i++)
      count++;


Difficulty level
This exercise is mostly suitable for students
O(sqrt(n))

Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Bellman-Ford Algorithm