Pergunta de entrevista da empresa Mastercard

Write a code to print a tree without using recursion.