I am unable to figure out how to build this tree? In my opinion every time we give the input for pre order it would build a skew tree because there are no indications like -1 for making the root point to NULL etc.
Create tree ( Using preorder and inorder) doubt1
Sir, I am unable to understand the input format. Like how to interpret the input numbers. Like in sample input 3 1 2 3 3 3 2 1, number of node are 3 and elements are 1 2 3 but if interpret the elements in pre order it would be like 1 is the root and root->left = 2 and 2->left = 3. Always there will be a skew tree formed with no element on ->right side ?