title: What is the running time of two separate for loops vs. two nested for loops?
body: <p>In this example, I have two separate for loops. Is the running time O(num1 + num2)?</p>
  
  <pre><code>for(int i=0; i&lt; num1 ; i++)     
  {
     print i;
  }
  
  for(int i=0 ; i&lt;num2 ; i++)
  {
      print i;
  }
  </code></pre>
  
  <p>And for this example, there is a nested for loop. Would the running time be O(num1*num2) because for each number in 0 to num1, you have to iterate from 0 to num2?</p>
  
  <pre><code> for(int i=0 ; i&lt;num1 ; i++)
   {
       for(int j=0 ; j&lt;num2 ; j++)
       {  
           print i;
       }
  }
  </code></pre>