What's the time complexity (O(n), O(n^2), etc.) of the algorithm below : <p>Me and my friend were wondering what the time complexity of the below algorithm is. I think it's O(n) but he's saying it's O(n^2). I just wanted second/third/however many opinions</p>

<pre><code>def sorting(seq):

   T = BinarySearchTree()
   for i in seq:       #The insert function is part of the BST class and thus it
      T.insert(i)     #follows the rules for binary tree insertion.
   return inorder(T)   #This will return an inorder traversal of the newly 
                     constructed tree
</code></pre>
