title: Algorithm time complexity types explaining
body: <p>I read about time complexity of an algorithm and I don't know if I understand... All examples below are created in C++. Please lets me know if I am wrong:</p>
  
  <p><code>O(1)</code>:</p>
  
  <pre><code>int k;
  k = 0;
  </code></pre>
  
  <p><code>O(n)</code>:</p>
  
  <pre><code>for(int i=0; i&lt;n; i++) {
     k[i] = i%10;
  }
  </code></pre>
  
  <p><code>O(n^2)</code>:</p>
  
  <pre><code>for(int i=0; i&lt;n; i++) {
     for(int j=0; j&lt;n; j++) {
        k[j] = i%10;
     }
  }
  </code></pre>
  
  <p><code>O(n^k)</code>(k is a known number - there are <code>k</code> for statements):</p>
  
  <pre><code>for(int i=0; i&lt;n; i++) {
     for(int j=0; j&lt;n; j++) {
        .......
        for(int f=0; f&lt;n; f++) {
           k[j][f] = p%10;
        }
        .......
     }
  }
  </code></pre>
  
  <ol>
  <li><p>What is <code>O(k^n)</code>? What is <code>O(log n)</code> and <code>O(n * log n)</code>? Please take me an algorithm (code) example for each one.</p></li>
  <li><p>Am I wrong with examples above?</p></li>
  </ol>