Check if the tree is a balanced tree