摘要: Sort a linked list inO(nlogn) time using constant space complexity.Code:class Solution {public: ListNode *sortList(ListNode *head) { if(!head) return head; map> sortMap; vector sortVector; ListNode *anchor=new ListNode(0); anchor->next=head; ListNode *cur... 阅读全文
posted @ 2013-11-18 11:56 WinsCoder 阅读(211) 评论(0) 推荐(0) 编辑