DP World interview question

Question realted to trees and linked lists.