LeetCode
Construct Binary Search Tree from Preorder Traversal
Click
here
for an explanation.