算法精粹(algorithm-essentials)

感谢soulmachine@github提供内容
## Remove Duplicates from Sorted List


### 描述

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`.


### 分析




### 递归版

{% codesnippet "./code/remove-duplicates-from-sorted-list-1."+book.suffix, language=book.suffix %}{% endcodesnippet %}


### 迭代版

{% codesnippet "./code/remove-duplicates-from-sorted-list-2."+book.suffix, language=book.suffix %}{% endcodesnippet %}


### 相关题目

* [Remove Duplicates from Sorted List II](remove-duplicates-from-sorted-list-ii.md)