Preorder's first element is the root of the tree. After getting the position it appeared in the inorder traversal array, the position should be served as a watershed separating the left and right subtree. By applying this idea recursively we can build the tree from preorder and inorder traversal array.<br/><br/>E.g.<br/>Simplest Case: if there are only three elements in the array, then the first element in preorder array is the root of the tree. After getting the position of that element in inorder array, the left adjacent node is the left leaf, the right adjacent node is the right leaf of the three elements tree.