Novopay Solutions interview question

write an algorithm to check for binary tree