What is the running time of the following piece of code ?
void function(int n){
     if(n==1) return ;
     for(int i=1; i<=n; i++)
          for(int j=1; j<=n;j++)
                break;
} 
Difficulty level
 
This exercise is mostly suitable for students
O(n)Back to the list of exercises
Looking for a more challenging exercise, try this one !!
 Hash coalesced with separated zones to separate chaining  with BSTs
 Hash coalesced with separated zones to separate chaining  with BSTs