2. Given the preorder and inorder traversals of a binary tree,you build that binary tree. < 8…

2. Given the preorder and inorder traversals of a binary tree,you build that binary tree. < 8 > Preorder: X        B         G        Y        D        E         C        N         Inorder:   Y        G        B         D        X        E         C         N . . .