LintCode删除排序链表中的重复数字 II
来源:互联网 发布:mac上好用的翻墙软件 编辑:程序博客网 时间:2024/06/05 07:26
public static ListNode deleteDuplicates(ListNode head) { if(head == null || head.next == null) { return head; } else { ListNode newHead = new ListNode(0); newHead.next = head; ListNode pre = newHead; ListNode p = head; ListNode next = null; while(p != null && p.next != null) { next = p.next; if(p.val == next.val) { while(next != null && p.val == next.val) { next = next.next; } pre.next = next; p = next; } else { pre = p; p = p.next; } } return newHead.next; }}
阅读全文
0 0
- LintCode-删除排序链表中的重复数字 II
- lintcode-删除排序链表中的重复数字II-113
- lintcode-删除排序链表中的重复数字 II
- LintCode(M)删除排序链表中的重复数字 II
- lintcode,删除排序链表中的重复数字 II
- LintCode 删除排序链表中的重复数字 II
- 删除排序链表中的重复数字 II -LintCode
- 删除排序链表中的重复数字 II -LintCode
- [LintCode]113.删除排序链表中的重复数字 II
- LintCode删除排序链表中的重复数字 II
- [Lintcode]Remove Duplicates from Sorted List II 删除排序链表中的重复数字 II
- LintCode-删除排序数组中的重复数字 II
- lintcode-删除排序数组中的重复数字II-101
- LintCode 删除排序数组中的重复数字 II
- LintCode-删除排序数组中的重复数字 II
- lintcode删除排序数组中的重复数字 II
- LintCode(101)删除排序数组中的重复数字 II
- LintCode:删除排序数组中的重复数字 II
- 命令学习
- ArrayList(数组列表)
- Android 自定义 EditText 达到从右边输入的效果
- JSTL中<c:forEach ...>标签详解
- KMP算法深入理解
- LintCode删除排序链表中的重复数字 II
- JVM系列七(垃圾收集器)
- Two Sum
- android studio 导入自己编译的Framework.jar的方法
- java中 flush()方法
- 关于 Android NumberPicker 的两个问题
- having 与where的区别
- 函数的学习
- 在tensorflow中使用CNN