class Solution:
def sortInList(self , head ):
lis1 = [ ] # 创建一个列表
while head:
lis1.append(head.val) # 将链表的值填到列表中
head = head.next
lis1.sort() # 列表排序
tem = ListNode(0) # 创建一个新链表
phead = tem # 定义头
for i in lis1:
phead.next = ListNode(i) # 将拍好的列表值添加到链表中
phead = phead.next
return tem.next
03-11
52
01-25
549
01-14
347
06-21
357