Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. Brian W. Kernighan

Non Recursive Traversal

Language Java | Level Intermediate | Category Data structure | September 8, 2015 8:46 am


Data structure Description

Write a program to traverse binary tree using Post-order, Pre-order, in-order and reverse order without Recursive function.


Output

   					 

Values from Binary tree: 4   8   12   20   10   22   14   
Values from Binary tree traverse using postorder: 4 12 8 10 14 22 20 
Values from Binary tree traverse using preorder: 20 8 4 12 22 10 14 
Values from Binary tree traverse using inorder: 4 8 12 20 10 22 14 
Values from Binary tree traverse using reverseOrder: 20 22 14 10 8 12 4

				    

Comments


No comments available!

Please login to add comments.