Agoda interview question

implement Tree structure