辅助数组排序

1.遍历链表,转化为数组

2.对数组排序

3.将数组又转化为链表

class Solution:
    def sortInList(self , head: ListNode) -> ListNode:
        # write code here
        num_list = []
        while head:
            num_list.append(head.val)
            head = head.next 
        num_list.sort()
        N0 = ListNode(-1)
        cur = N0
        for v in num_list:
            cur.next = ListNode(v)
            cur = cur.next
        return N0.next