Scotiabank Interview Question

Tree and set problems from data structure