Domanda di colloquio di Pocket Gems

Given a preorder traversal construct a valid binary search tree.