自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 Leetcode 145. Binary Tree Postorder Traversal

递归/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ cl...

2018-03-30 22:38:08 89

原创 Leetcode 144. Binary Tree Preorder Traversal

Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3 return [1,2,3].递归/** * Definition for a binary tree nod...

2018-03-30 20:38:39 76

原创 ***Leetcode 146. LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.get(key) - Get the value (will always be positive) of the key if the ...

2018-03-30 10:56:12 125

原创 用两个栈来实现一个队列

用两个栈来实现一个队列,完成队列的Push和Pop操作。 队列中的元素为int类型。class Solution { public: void push(int node) { stack1.push(node); } int pop() { if (stack1.empty() && stack2.empty()) ret...

2018-03-29 21:57:22 129

原创 重建二叉树

输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。/** * Definition for binary tree * struct TreeNode { * int val; * TreeN

2018-03-28 20:20:25 97

转载 markdown编辑方法

# 欢迎使用Markdown编辑器写博客本Markdown编辑器使用[StackEdit][6]修改而来,用它写博客,将会带来全新的体验哦:- **Markdown和扩展Markdown简洁的语法** - **代码块高亮** - **图片链接和图片上传** - ***LaTex*数学公式** - **UML序列图和流程图** - **离线写博客** - **导入导出Markdown文件** - **

2018-03-28 20:19:08 234 1

原创 扑克牌大小

扑克牌大小

2018-03-21 17:35:14 817

原创 错误记录

开发一个简单错误记录功能小模块,能够记录出错的代码所在的文件名称和行号。 处理: 1.记录最多8条错误记录,对相同的错误记录(即文件名称和行号完全匹配)只记录一条,错误计数增加;(文件所在的目录不同,文件名和行号相同也要合并) 2.超过16个字符的文件名称,只记录文件的最后有效16个字符;(如果文件名不同,而只是文件名的后16个字符和行号相同,也不要合并) 3.输入的文件可能带路径,记录...

2018-03-21 15:47:27 128

原创 二维数组中的查找

class Solution { public: bool Find(int target, vector<vector<int> > array) { if (array.size() == 0) return false; if (array[0].size() == 0) return false; vecto...

2018-03-20 11:31:18 126

原创 Leetcode 139. Word Break

word break

2018-03-19 22:33:25 137

原创 Leetcode 138. Copy List with Random Pointer

copy list with random pointer

2018-03-18 22:52:29 89

原创 Leetcode 137. Single Number II

single number

2018-03-15 17:54:47 100

原创 leetcode 135. Candy

leetcode 135. candy

2018-03-01 17:47:54 120

空空如也

空空如也

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

TA关注的人

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