摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2014-07-28 21:11 Double_win 阅读(489) 评论(0) 推荐(0) 编辑
摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.题意:对k个有序的链表进行归并排序。并分析其复杂度。/** * Definition for singly-... 阅读全文
posted @ 2014-07-28 20:44 Double_win 阅读(533) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort.题目要求:链表的插入排序,由于没有时间复杂度的要求,可以直接循环操作。/** * Definition for singly-linked list. * struct ListNode { * int val;... 阅读全文
posted @ 2014-07-28 19:55 Double_win 阅读(656) 评论(0) 推荐(0) 编辑