83. Remove Duplicates from Sorted List
来源:互联网 发布:惠州网络车问政平台 编辑:程序博客网 时间:2024/06/15 01:37
图解分析
当p_current->val==p_next->val
当p_current->val!=p_next->val :p_current指针向前移动
C实现代码如下:
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */
struct ListNode *deleteDuplicates(struct ListNode *head){ if(head==NULL) return head; struct ListNode *p_current=head; struct ListNode *p_next=head->next; While(p_current!=NULL&&p_next!=NULL){ if(p_current->val==p_next->val) p_current->next=p_next->next; else p_current=p_next; p_next=p_next->next; } return head;}
LeetCode实现代码
阅读全文
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
- C#获取ip地址、dns、mac地址、cpu信息
- Consul 删除无效的服务或多实例下的无效节点
- 联币网与7宝网达成战略合作,未来是数字资产时代
- bankForJS_createClass
- 补码理解
- 83. Remove Duplicates from Sorted List
- 2017/8/30工作总结
- 未解决问题
- 在vim中使用shell命令的方法以及foreach循环的使用.
- Find The Determinant III SPOJ
- Guess Next Session
- MySQl启动异常:net start mysql 服务名无效
- Django(五)--分页器(paginator)
- THC63LVD827:RGB转双路LVDS规格书