title: What is the Time complexity of this Algorithm using AVL tree and Binary tree
body: <p>Consider the following algorithm that sorts a list of n elements by using a binary search tree:</p>
  
  <pre><code>initialise t to be an empty binary search tree
  for each element x in the list,
    add x to t
  while t is not empty,
    remove and print the smallest element of t
  </code></pre>
  
  <p>What is the worst-case time complexity of this algorithm, if the tree is
  implemented using:</p>
  
  <p>a) an ordinary binary search tree?<br>
  b) an AVL tree?</p>
  
  <p>My Solution: What i think the solution would be, for AVL tree: O(Log N) and for BST it would be O(N)</p>