basic version
minor change from buildTree. preorder: root-left-right, postorder: left-right-root
sol of q106