题目 :
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2
, return 1->2
.
Given 1->1->2->3->3
, return 1->2->3
.
(1)算法思想:
顺序遍历一次即可,遇到重复的就删除。
(2)代码如下:
Remove Duplicates from Sorted List
原文:http://blog.csdn.net/littlebob180/article/details/42806671