Method to check if balanced BST