build BT from traversal