Copied BST and AVL implementations from CS315-Lab7