check if binary tree balanced