19. Remove Nth Node From End of List
来源:互联网 发布:每日一文 知乎 编辑:程序博客网 时间:2024/04/29 13:21
ListNode* removeNthFromEnd(ListNode* head, int n) { ListNode* first = head; ListNode* second = head; int i = 0; while (second) { i++; second = second->next; } int j= 0; if(i==n) return head->next; while (j < i-n -1) { first = first->next; j++; } first->next = first->next->next; return head;}
0 0
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node from End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- Remove Nth Node From End of List
- HTTPS协议与SSL协议的完整交互过程
- Android中实现点击变换图片
- 设计模式六大原则
- 【leetcode】Array——First Missing Positive(41)
- 「学习笔记」3.19代码学习
- 19. Remove Nth Node From End of List
- HTML入门(2)
- 【DBaas】如何建立一个Oracle 数据库云服务
- SDL学习小结(1)
- POJ2420爬山算法
- [Docker] ubuntu14.04LTS 上部署自己的 provider docker registry
- GDCPC GO
- poj 1083
- 互联网架构设计之Redis篇-【Redis Windows版本安装过程】