One of my most productive days was throwing away 1000 lines of code. Ken Thompson

Print Binary Tree in Vertical Order

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


Data structure Description

Write a program to Print Binary Tree in Vertical Order.

If two nodes have the same Horizontal Distance then they are on the same vertical line. Print the values from the first vertical line, second vertical line and more.


Output

   					 

All Binary Tree Values: 4  8  10  12  14  20  22  
Print Values from Binary tree perimeter: 
20,12
8,10
4
14,22

				    

Comments


No comments available!

Please login to add comments.