title: Big O for 3 nested loops
body: <p>Another Big O notation question...What is the Big O for the folling code:</p>
  
  <pre><code>     for (int i = n; i &gt; 0; i = i / 2){
          for (int j = 0; j &lt; n; j++){
             for (int k = 0; k &lt; n; k++){
                count++;
             }
          }
       }
  </code></pre>
  
  <p>My Thoughts:
  So breaking it down, I think the outside loop is <code>O(log2(n))</code>, then each of the inner loops is <code>O(n)</code> which would result in <code>O(n^2 * log2(n))</code>  Question #1 is that correct?  </p>
  
  <p>Question #2:
  when combining nested loops is it always just as simple as mulitply the Big O of each loop? </p>