Nested loops: Still $\mathcal O(n)$?
What you have there is not a true nested loop. It's one loop with, what is equivalently an if-test in there, like:

while(i&lt;n){
   if(cond)
      //something Θ(1)
   else
      //some other Θ(1) thing
   i++
}


Notice in your case, you have the same variable for both loops with no reset.

So, to answer your question, the running time is $\Theta(n)$.  In particular, it is $O(n)$.

As a commenter states, anything that is $O(n)$ is also $O(n^2)$.