
数据结构与算法
beSteping
这个作者很懒,什么都没留下…
展开
-
leetcode 链表系列
leetcode 链表系列1、 反转链表2、 链表中间段逆序3、 合并有序链表4、求两个链表的交叉点5、判断链表是否有环 1、 反转链表 https://leetcode.com/problems/reverse-linked-list/solution/ Assume that we have linked list 1 → 2 → 3 → Ø, we would like to change ...原创 2018-12-30 22:57:33 · 244 阅读 · 0 评论 -
leetcode 栈、队列、堆相关
leetcode 栈、队列、堆相关1、使用队列实现栈2、用栈实现队列 1、使用队列实现栈 https://leetcode.com/problems/implement-stack-using-queues/ class MyStack { private Queue<Integer> queue; /** Initialize your da原创 2019-01-07 23:43:41 · 238 阅读 · 0 评论 -
leetcode 贪心算法相关
leetcode 贪心算法相关1.1 分糖果 1.1 分糖果 https://leetcode.com/problems/assign-cookies/ class Solution { public int findContentChildren(int[] g, int[] s) { Arrays.sort(g); Arrays.sort(s); ...原创 2019-01-13 19:54:07 · 291 阅读 · 0 评论