
leetcode
文章平均质量分 81
jy7788
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
232用两个栈实现队列
leetcode中要求用栈实现队列的一下四个方法。 push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.empty() -- Return whether the queue is原创 2015-07-21 16:00:49 · 655 阅读 · 0 评论 -
leetcode单链表总结
首先要链表的node类。 public class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } 83:Remove Duplicates from Sorted List删除有序链表中重复元素 思路:由于链表是有序的,只需要定义一前一后两个对象q,p。如果两个对象所指向原创 2015-07-21 16:25:29 · 415 阅读 · 0 评论