Input: PST pst
Output: the root node of TPST tpst
Map < PSTNode, TPSTNode > ;
for each node of pst in level-order do
  TPSTNode = transToTPSTNode();
(4)   map.put;
(5) end
(6) ;
(7) root_ = constructTPST();
(8) root_ = checkTPST();
(9) return root_tpst;
Algorithm 1: Converting PST to TPST.