Pergunta de entrevista da empresa Bentley Systems

Traverse a tree both iteratively and recursively.