sort list to balanced tree