Be the first user to complete this post

Add to List 
131. Find the Height of a tree without using Recursion
Objective:  Find the Height of a tree without Recursion.
In our earlier post "Height of tree" we used recursion to find it. In this post, we will see how to find it without using recursion.
Approach:
 Initialize height variable to 0.
 Utilize a Queue data structure similar to Level Order Traversal.
 At each level, use NULL as a marker to indicate the end of the level.
 Add the root node to the Queue and also add NULL as the marker for the first level.
 Dequeue a node from the Queue.
 If the dequeued node is NULL, it indicates the end of a level or the traversal of the entire tree. Check if the Queue is empty, indicating traversal completion. If not empty, add NULL as a marker for the next level and increment the height by 1.
 If the dequeued node is not NULL, enqueue its children into the Queue.
 Repeat steps 5 to 7 until the Queue becomes empty.
 See the code below for better explanation
Output:
Tree Height 4