Given pointer to the root node of a binary tree of integers, write a function to print elements of the tree in its level-order traversal. You can assume that the header queue
is already imported and print using cout for which the header iostream
is also imported.
You need to write a function named "level_order" that will take root of a binary tree of integers as argument.
OutputYour function should print all the elements in the binary tree in its level-order traversal, one element in each line.