title: Complexity analysis of the printParty method
body: <pre><code>void printParty(int N) {
     for (int i = 1; i &lt;= N; i *= 2) {
        for (int j = 0; j &lt; i; j += 1) {
           System.out.println("hello");
        }
     }
  }
  </code></pre>
  
  <p>I sort of get that this code's complexity is N but more clarification would be appreciatd.</p>
  
  <p>Also I had another thought which was</p>
  
  <pre><code>void printParty(int N) {
     for (int i = 1; i &lt;= N; i++) {
        for (int j = 0; j &lt; i; j *= 2) {
            System.out.println("hello");
        }
     }
  }
  </code></pre>
  
  <p>I think the last code snippet would have complexity of NlogN....
  My friend says it's the same as the one above.</p>
  
  <p>Can you help me visualize this.</p>