More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity. W.A. Wulf

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.