tree: validate binary tree