title: What are the Big O Notation for these for loops?
body: <p>I am finishing up an assignment for my class, this particular section involves giving an "analysis" of the running time for several for loops. The instructor specified that he wants a Big Oh Notation answer.</p>
  
  <p>I am building on the foundation that total running time is based on:</p>
  
  <pre><code>1)The cost of executing each statement
  2)The frequency of execution of each statement
  3)The idea of working from "inside and out", specifically starting from inner loops.
  </code></pre>
  
  <p>I know that:</p>
  
  <pre><code>total = 0;
  
     for (int i = 0; i &lt; n;i++){
      total++;
  }
  </code></pre>
  
  <p>Answer: O(N) its running linear.</p>
  
  <pre><code>for (int i = 0; i &lt; n;++i)
       for (int j = 0; j &lt; n;++j)
       total++;
  </code></pre>
  
  <p>Answer: O(N^2), we only care about how large N grows.</p>
  
  <p>I am confused on </p>
  
  <pre><code>for (int i = 0;i &lt; n;++i)
       for (j=0;j &lt; n * n;++j)
       ++total;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>for ( i = 0;i &lt; n;++i)
       for (j = 0; j &lt; i;++j)
       ++total;
  </code></pre>
  
  <p>And last but not least, I am assuming from my textbook that all Triple nested loops are running at N^3 time?</p>