text: The first node in preorder traversal is root . So take the node at preIndex from preorder and make it root , and increment preIndex
code: struct node * root = newNode ( pre [ * preIndex ] ) ; ++ * preIndex ;