I2F03. Level order traversal of a binary tree

Your task is to write a program that reads a non empty binary tree of
natural numbers, and prints its level order traversal (that is, from top
to bottom and from left to right), with a line for each level.

(To see an instance of the tree corresponding to the input-output
instance, consult the pdf or ps version of this wording.)

Input

The input consists of the description of non empty a binary tree of
natural numbers as it is explained at the exercise REREC of the subject
collection.

Output

Your program must print as many lines as levels, with the level order
traversal of the tree. Follow the format of the instances.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T12:21:42.461Z

© Jutge.org, 2006–2026.
https://jutge.org
