People think that computer science is the art of geniuses but the actual reality is the opposite, just many people doing things that build on each other, like a wall of mini stones. Donald Knuth

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.