Question 2: Level order traverse of a binary tree (breadth firsttraversal)
Level order traversal of the above tree is 1 2 3 4 5.
We can use a FIFO queue to implement the level order tranversalof a binary tree.
For each node, first the node is visited and then it’s childnodes are put in a FIFO queue.
Step 1: Create an empty queueStep 2: Start from the root, enqueue the rootStep 3: Loop whenever the queue is not empty a) dequeue a node from the front of the queue and print
OR
OR