leetcode --19. Remove Nth Node From End of List
来源:互联网 发布:淘宝游戏光盘 编辑:程序博客网 时间:2024/06/10 07:33
题目:https://leetcode.com/problems/remove-nth-node-from-end-of-list/description/
代码:
class Solution {public: ListNode* removeNthFromEnd(ListNode* head, int n) { ListNode *pre=head,*q=pre; for (int i = 0; i < n; i++){ q = q->next; } if(q==NULL){ head = head ->next; return head; } while(q->next != NULL){ q = q->next; pre = pre->next; } pre ->next = pre ->next->next; return head; }};
阅读全文
0 0
- 19. Remove Nth Node From End of List leetcode list
- [LeetCode]19.Remove Nth Node From End of List
- LeetCode 19. Remove Nth Node From End of List
- 19. Remove Nth Node From End of List Leetcode Python
- LeetCode --- 19. Remove Nth Node From End of List
- LeetCode 19.Remove Nth Node From End of List
- [Leetcode] 19. Remove Nth Node From End of List
- [leetcode] 19.Remove Nth Node From End of List
- <LeetCode OJ> 19. Remove Nth Node From End of List
- 19. Remove Nth Node From End of List LeetCode
- leetcode 19. Remove Nth Node From End of List
- [LeetCode OJ] 19. Remove Nth Node From End of List
- LeetCode 19. Remove Nth Node From End of List
- Leetcode:19. Remove Nth Node From End of List(JAVA)
- leetcode 19. Remove Nth Node From End of List
- Leetcode 19. Remove Nth Node From End of List
- 【LeetCode】19. Remove Nth Node From End of List
- leetcode 19.Remove Nth Node From End of List
- 列表(list)
- 实现图片通过滚轮的放大缩小
- javaScript内置对象Boolean
- 180度vr直播用,鱼眼视频展开到全景
- SQLite3性能深入分析
- leetcode --19. Remove Nth Node From End of List
- linux 修改文件权限
- 计算机网络
- UVA
- 2017/8/11 离线赛
- Hibernate与JPA
- Spring学习笔记—基础知识
- Linux 小记
- 数据结构实验之排序六:希尔排序