Question: A binary tree structure is defined as follows: struct Tree { int item; struct Tree * left_child; struct Tree * right_child; } If a left
A binary tree structure is defined as follows: struct Tree { int item; struct Tree * left_child; struct Tree * right_child; } If a left child or right child does not exist, the corresponding member variable is set to NULL. Write a function int print_level(struct Tree * tree) that prints the nodes in LEVEL-ORDER, but for each node, IT ALSO PRINTS THE LEVEL. Your program should not crash. If it is easier, you can assume you already have implementations for lists, stacks and queues of integers that you can use in your function.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
