update the preorder of binary tree
a leetcode problem pow