Driver Code
let In = [ 4 , 8 , 2 , 5 , 1 , 6 , 3 , 7 ] ; let post = [ 8 , 4 , 5 , 2 , 6 , 7 , 3 , 1 ] ; let n = In . length ; let root = buildUtil ( In , post , 0 , n - 1 , 0 , n - 1 ) ; document . write ( " " ) ; preOrder ( root ) ;