Hello, constructing a tree given it's inorder is easy enough.
But, let's say you are supposed to construct a tree based on it's preorder (+ + y z + * x y z
for example).
It's easy to see that +
is the root, and how to continue in the left subtree from there.
But.. how do you know when you are supposed to "switch" to the right subtree?