added an optimal BST implementation