DP World Interview Question

Question realted to trees and linked lists.