CTCI 4.1 check if binary tree is balanced