title: Handling duplicates keys within an AVL tree
body: <p>I want to make my <code>avl-tree</code> support duplicate keys but there is a problem with the default behavior of the <code>binary search tree</code> with duplicates that the rotation could make nodes with equal key be on the left and the right of the parent.</p>
  
  <p>For example when adding three nodes all with key A  will cause the tree to do a rotation to be something like this:</p>
  
  <pre><code>   A
    /  \ 
   A    A
  </code></pre>
  
  <p>So getting all the entries with that key will be a problem...and searching in both direction is not good.</p>
  
  <p>The solution that i have thought of is making each node stores an array of duplicates
  so when adding a new item that already exists will be just adding a new item to the array ,
  removing item with key will delete the whole node while the find all items with key will return that array.</p>
  
  <p>Are there are any other methods to handle duplicates ?</p>
  
  <p>The insert item takes a key and a value .. so i need to store the values inorder to return them by the findAll with certain key method.</p>