Big O notation for Sorting Algorithm
You will have $O(n^2)$ in worst case. Actually what you do is really close to insertion sort. Worst case is attained when you got the array in decreasing order. 

\begin{align}
T(n) &amp;= T(n-1) + n\\
&amp;=T(n-2) + n-1 + n \\
&amp;= \vdots \\
&amp;=T(n-k) + \sum_{i=0}^k (n - i)
\end{align}
Algorithm terminates at $k = n$, i.e. we shall get
$$T(n) = T(0) + \sum_{i=0}^n (n - i)$$
where $T(0) = O(1)$. So, upon a change of variable, we get
 $$T(n) = \sum_{i=0}^n i = \frac{n(n+1)}{2} = O(n^2)$$