title: What is the time complexity of traversing a 2d array
body: <p>What is the time complexity of traversing (rows ,columns) a two dimensional array?</p>
  
  <pre><code>bool check(int array [9][9])
  { 
      int num=0;
      for (int i = 0; i &lt; 9; i++) {
          for (int j = 0; j &lt; 9; j++) { 
              if (array [i][j] == 0) {        
                  num++;
              }
          }
      }
      return num;
  }
  </code></pre>
  
  <p>I think each for <code>loop</code> will take square root of  <code>n</code> so that nested loops totally take <code>O(n)</code> as traversing all elements, where I am defining <code>n</code> as the total size of the input (in this case 81 elements in <code>array</code>). Is that correct?</p>