build tree from list
sortTree, mkTree