自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Pilgrim

希望某一天跪在那片向往的圣地,满含热泪,亲吻大地,将那之前所经历的种种痛苦,笑着说出来......

  • 博客(10)
  • 资源 (1)
  • 收藏
  • 关注

原创 **Leetcode 210. Course Schedule II | 多源点拓扑排序

https://leetcode.com/problems/course-schedule-ii/description/class Solution { public: vector<int> findOrder(int n, vector<pair<int, int>>& pres) { vector< vector&l...

2018-06-28 10:12:58 161

原创 **Leetcode 621. Task Scheduler

https://leetcode.com/problems/task-scheduler/description/不知道为啥模拟写残了,然后思路可以参考这里https://www.cnblogs.com/grandyang/p/7098764.html这道题让我们安排CPU的任务,规定在两个相同任务之间至少隔n个时间点。说实话,刚开始博主并没有完全理解题目的意思,后来看了大神们的解法才悟出个道理来...

2018-06-28 02:18:11 123

原创 ***Leetcode 354. Russian Doll Envelopes

https://leetcode.com/problems/russian-doll-envelopes/description/LIS就能过掉然后暴力O(n^2)的写法bool cmp_small(pair<int, int> a, pair<int, int>b) { if (a.first == b.first) return a.second > b....

2018-06-27 23:35:28 139

原创 **剑指offer-70-53 0-n-1中缺失的数字

如果原来的数组无序,那么hash O(n)https://www.lintcode.com/problem/missing-number/descriptionclass Solution { public: /** * @param nums: An array of integers * @return: An integer */ int fin...

2018-06-25 00:44:36 305

原创 剑指offer-70-43 1-n整数中1出现的次数

https://www.nowcoder.com/practice/bd7f978302044eee894445e244c7eee6?tpId=13&tqId=11184&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking不错的题分几种来考虑1、最高...

2018-06-22 15:52:21 213

原创 剑指offer-70-36 二叉搜索树转双向链表

https://www.nowcoder.com/practice/947f6eb80d944a84850b0538bf0ec3a5?tpId=13&tqId=11179&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking想明白过程就很简单,记录上一...

2018-06-21 23:29:36 80

原创 剑指offer(第二版)33 判断后序遍历序列是否是二叉搜索树的

https://www.nowcoder.com/practice/a861533d45854474ac791d90e447bafd?tpId=13&tqId=11176&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-rankingclass Solution...

2018-06-19 01:24:35 116

原创 *剑指offer(第二版)31 栈的压入、弹出序列

https://www.nowcoder.com/practice/d77d11405cc7470d82554cb392585106?tpId=13&tqId=11174&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking开一个辅助栈写代码会更清晰,...

2018-06-18 23:58:28 107

原创 **Leetcode 543. Diameter of Binary Tree | 树的直径

https://leetcode.com/problems/diameter-of-binary-tree/description//** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * T...

2018-06-17 00:15:19 176 1

原创 **Leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal

https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/description/有个地方,就是,如果对于中序遍历,l->r之间的是在左子树,那么对于后续遍历 post_left到 post_left + r - l -1这个区间对应的也是左子树/** * Definit...

2018-06-16 22:17:45 85

演示数据结构的算法过程

帮助数据结构学习,用flash动画生动的演示数据结构的算法过程

2014-01-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除