题目描述:
Sort a linked list using insertion sort.
题目大意:
使用插入排序对链表排序。
Python代码:
朴素版本( Accepted 2568ms ):
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
# @param head, a ListNode
# @return a ListNode
def ...