Infosys interview question

DSA Question about linked list, Trees