sortedlisttotree