Sort List
摘要:
Sort a linked list inO(nlogn) time using constant space complexity.逻辑正确,尾指针没有置空,调了好久……/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode *sortList(ListNode *head) {... 阅读全文
posted @ 2014-03-24 22:04 pengyu2003 阅读(135) 评论(0) 推荐(0) 编辑