83. Remove Duplicates from Sorted List
来源:互联网 发布:苹果手机芒果tv没网络 编辑:程序博客网 时间:2024/06/04 00:28
又是去重,简单题,链表
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNode* deleteDuplicates(ListNode* head) { if(head == NULL) return head; ListNode* t1 = head; ListNode* t2 = head; t2 = t2 -> next; while(t2 != NULL){ if(t1 -> val == t2 -> val){ t2 = t2 -> next; t1 -> next = t2; } else{ t1 = t1 -> next; t2 = t2 -> next; } } return head; }};
0 0
- [LeetCode]83.Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- [Leetcode] 83. Remove Duplicates from Sorted List
- LeetCode --- 83. Remove Duplicates from Sorted List
- [leetcode] 83.Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- LeetCode 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- 【leetcode】83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List LeetCode
- 83. Remove Duplicates from Sorted List
- leetcode 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- 83. Remove Duplicates from Sorted List
- [LeetCode]83. Remove Duplicates from Sorted List
- 【LeetCode】83. Remove Duplicates from Sorted List
- LeetCode 83. Remove Duplicates from Sorted List
- Codeforces Round #395 (Div. 2) -- C. Timofey and a tree(并查集+缩点)
- Java中static和final的区别
- shadow
- linux中配置虚拟主机
- learn python the hard way---ex52
- 83. Remove Duplicates from Sorted List
- (五十四)高并发服务器——多路IO转接机制poll模型
- 84. Largest Rectangle in Histogram
- angularjs directive 实例 详解
- 85. Maximal Rectangle
- pms包管理服务分析-PackageManagerService构造函数和包扫描过程
- <Python初学>基本数据list的操作
- JS 开启 win10 触屏键盘
- 226. Invert Binary Tree