Pregunta de entrevista de Pocket Gems

Given a preorder traversal construct a valid binary search tree.