Google Interview Question

Related to linked lists and trees