2015年10月17日

Reverse Nodes in k-Group

摘要: 1 class Solution { 2 public: 3 ListNode* reverseKGroup(ListNode* head, int k) { 4 if(head==NULL||knext;16 17 ... 阅读全文

posted @ 2015-10-17 16:17 RenewDo 阅读(112) 评论(0) 推荐(0) 编辑

Swap Nodes in Pairs

摘要: 1 class Solution { 2 public: 3 ListNode* swapPairs(ListNode* head) { 4 if(head==NULL||head->next==NULL) return head; 5 ListNode p... 阅读全文

posted @ 2015-10-17 15:18 RenewDo 阅读(124) 评论(0) 推荐(0) 编辑

Remove Nth Node From End of List

摘要: 效率不高,还是以前的思路,没有创新,下面是别人的一个比较好的 凡是说倒着第几个都可以利用顺着的第几个打个标记,然后另一个从头开始,这个继续直到这个到结尾。 阅读全文

posted @ 2015-10-17 14:50 RenewDo 阅读(116) 评论(0) 推荐(0) 编辑

导航