eBay Interview Question

check if two trees are similar