build btree from pre and in traversal reimpl