AVL tree and queue written