Javascript program to construct a tree using inorder and preorder traversal
class TreeNode { constructor ( x ) { this . val = x ; this . left = null ; this . right = null ; } } let set = new Set ( ) ; let stack = [ ] ;