ABBYY interview question

Check if the binary tree is balanced