摘要: Sort a linked list using insertion sort. 题意:使用插入排序排链表。 思路:所谓的插入排序法,可以理解为,从原链表中取结点,每次都从新的链表的开头开始遍历比较,在新链表中找到不小于当前节点的位置,然后将当前节点插入进去,依次重复这种过程,时间复杂度为O(n^2 阅读全文
posted @ 2017-07-17 18:15 王大咩的图书馆 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initia 阅读全文
posted @ 2017-07-17 16:48 王大咩的图书馆 阅读(195) 评论(0) 推荐(0) 编辑