title: Worst case Analysis On a loop
body: <p>So I wrote this loop but I'm having trouble analyzing its worst case time complexity. Any help would greatly be appreciated .</p>
  
  <p>factor is any arbitrary number 
  primeNumber is a list of prime numbers between 2 and the original value of factor</p>
  
  <pre><code>for (int i = 0; i &lt; primeNumbers.size() - 1; i++) {
      prime = primeNumbers.get(i);
      if(prime&lt;=factor) {
          if (factor % prime == 0) {
              factor = factor / prime;
              divisors.add(prime);
              i = 0;
          }
          if (factor &lt;= 3) 
              break;
      }
      else 
          break;
  }
  </code></pre>