A binary tree node has data , pointer to left child and a pointer to right child
public class Node { public char data ; public Node left , right ; public Node ( char item ) { data = item ; left = right = null ; } } class GFG { public Node root ; public static int preIndex = 0 ;