Skip to content

Latest commit

 

History

History

Vertical Order Of Binary Tree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Given a binary tree, print it vertically. The following example illustrates vertical order traversal.

       
           1
         /   \
       2       3
     /  \     /  \
   4     5   6    7
              \    \
               8    9            
              
The output of print this tree vertically will be:
4
2
1 5 6
3 8
7
9