摘要:
Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.旋转链表:... 阅读全文
posted @ 2014-10-26 10:21
Craze_lee
阅读(110)
评论(0)
推荐(0)
摘要:
Sort a linked list inO(nlogn) time using constant space complexity.链表排序。要达到nlogn的时间复杂度,能想到归并排序与快速排序。这里采用归并排序: 1 /** 2 * Definition for singly-linked ... 阅读全文
posted @ 2014-10-26 09:30
Craze_lee
阅读(129)
评论(0)
推荐(0)

浙公网安备 33010602011771号