Conversion of a Binary Search Tree to an AVL tree