摘要:
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... 阅读全文