Pergunta de entrevista da empresa Pegasystems

Top view of a binary tree, explain and code