Is O(N^2) nested for loop as O(N) while loop possible? : <p>Am I correct in saying that this code will execute in O(N) time? This is to iterate through a map&lt; int, vector&lt; int > >. </p>

<pre><code>  int counter = 0;
  unsigned int u = 0;
  unsigned int v = 0;
  bool notDone = true;
  while (notDone) {
    if (u &lt; map.size()) {
      if (v &lt; map.at(u).size()) {
        if (map.at(u)[v] == -1) {
          ++v;
        }
        else {
          ++counter;
          ++v;
        }
      }
      else {
        v = 0;
        ++u;
      }
    } else {
      notDone = false;
    }
  }
</code></pre>
