摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, return1->2->3.分析:这道题很简单,循环遍历每个结点,当遇到相同的结点,则该链表结点的next就指向该链表结点next的next,否则,继续探测该节点的next结点。/** * Definition for singly-linked lis 阅读全文
posted @ 2014-03-06 20:30 Awy 阅读(147) 评论(0) 推荐(0) 编辑