Driver Code
public static void Main ( string [ ] args ) { GFG tree = new GFG ( ) ; int [ ] @in = new int [ ] { 4 , 8 , 2 , 5 , 1 , 6 , 3 , 7 } ; int [ ] post = new int [ ] { 8 , 4 , 5 , 2 , 6 , 7 , 3 , 1 } ; int n = @in . Length ; Node root = tree . buildTree ( @in , post , n ) ; Console . WriteLine ( " Preorder ▁ of ▁ the ▁ constructed ▁ tree ▁ : ▁ " ) ; tree . preOrder ( root ) ; } }