Novopay Solutions Interview Question

write an algorithm to check for binary tree