摘要:
1 class Solution { 2 public: 3 ListNode *removeNthFromEnd(ListNode *head, int n) { 4 5 ListNode* fake = new ListNode(-1); 6 fake->next = head; 7 ListNode* p = fake... 阅读全文
posted @ 2017-05-19 10:51
wxquare
阅读(351)
评论(0)
推荐(0)
摘要:
Given a list, rotate the list to the right by kplaces, where k is non-negative. For example:Given1->2->3->4->5->NULLand k =2,return4->5->1->2->3->NULL 阅读全文
posted @ 2017-05-19 10:47
wxquare
阅读(304)
评论(0)
推荐(0)
摘要:
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 阅读全文
posted @ 2017-05-19 10:44
wxquare
阅读(244)
评论(0)
推荐(0)
摘要:
面试中经常会碰到单链表的排序,主要是插入排序和归并排序 插入排序: 归并排序: 阅读全文
posted @ 2017-05-19 10:35
wxquare
阅读(360)
评论(0)
推荐(0)
摘要:
ListNode* reverseList(ListNode* head) { if (head == nullptr || head->next == nullptr) return head; ListNode* dummy = new ListNode(-1); dummy->next = head; ListNode* p = head->next; ... 阅读全文
posted @ 2017-05-19 10:28
wxquare
阅读(252)
评论(0)
推荐(0)

浙公网安备 33010602011771号