title: Complexity Analysis in C++
body: <p>Can you guys help me determine the complexity of the following implementations of algorithms to add, multiply and transpose n X n matrices:
  Thanks so much !!</p>
  <pre><code>for(i = 0; i &lt; n; i++)
     for( j = 0; j &lt; n; j++)
        a[i][j] = b[i][j] + c[i][j];
  
  
  for( i = 0; i &lt; n; i++)
     for(j = 0; j &lt; n; j++)
        for(k = a[i][j] = 0; k &lt; n; k++)
           a[i][j] += b[i][k] * c[k][j]; 
  
  
  for(i = 0; i &lt; n - 1; i++)
     for(j = i + 1; j &lt; n; j++){
        tmp = a[i][j];
        a[i][j] = a[j][i];
        a[j][i] = tmp;
  </code></pre>
  <p>}</p>