title: What is the time complexity of while loops?
body: <p>I'm trying to find the time complexity of while loops and I have no idea where to begin. I understand how to find the complexity class of for loops, but when it comes to while loops, I get completely lost. Any advice/tips on where to begin?</p>
  
  <p>Here is an example of a problem:</p>
  
  <pre><code>x = 0;
  A[n] = some array of length n;
  while (x != A[i]) {
     i++;
  }
  </code></pre>