# Can one insert non-unique elements into an AVL tree?

Is it possible to insert a sequence of non-unique elements into an AVL tree?

For example, what is the AVL tree result of inserting 3, 3, and 3 into an initially empty AVL tree?

Is it:

        3
/   \
3     3

• What do you think? – Raphael Mar 1 '15 at 23:59

• No, using this method would result in a single node $n = (3, 3)$ representing that entire subtree, where the node's first component is the key and the second component is its count. – Francesco Gramano Mar 1 '15 at 19:46