
一一『 LeetCode 』
文章平均质量分 59
SunliyMonkey
想要飞,就必须永不妥协
展开
-
LeetCode 97: Interleaving String 字符串交错
给定三个字符串S1,S2,S3,判断S3是否能够由S1,S2交错组合而成。考察点:动态规划陷阱:无原创 2015-09-01 22:50:00 · 1632 阅读 · 0 评论 -
LeetCode 113: Path Sum II 二叉树遍历
题目描述给一棵二叉树,每个节点带有数字,寻找出从根到叶子节点所有的路径,使得路径上的数字之和为给出的sum。考察点:1. 树的遍历2. vector的使用:push_back, pop_back陷阱:无原创 2015-09-01 21:58:16 · 1511 阅读 · 0 评论 -
LeetCode 230: Kth Smallest Element in a BST 查找二叉排序树
博客转载请注明地址:题目描述题目地址:https://leetcode.com/problems/kth-smallest-element-in-a-bst/ 在一颗二叉排序树当中,寻找第k大的数。考察点递归树的遍历陷阱无Code/** * Definition for a binary tree node. * struct TreeNode { * int val; *原创 2015-09-02 15:34:44 · 1916 阅读 · 0 评论 -
LeetCode 4:Median of Two Sorted Arrays
博客转载请注明地址:题目描述题目地址:https://leetcode.com/problems/median-of-two-sorted-arrays/ 给出两个有序数组,求两个有序数组合并在一起的中位数是多少?考察点二分查找,分治分类讨论思路传统的二分查找在[L,R][L,R]区间求出满足条件的值。该题是一个举一反三,希望在区间([L1,R1],[L2,R2])([L_1,R_1],[L原创 2015-09-07 20:18:15 · 708 阅读 · 0 评论 -
LeetCode 124: Binary Tree Maximum Path Sum 树形动态规划
博客转载请注明地址:http://blog.youkuaiyun.com/sunliymonkey/article/details/48179427题目描述题目地址:https://leetcode.com/problems/binary-tree-maximum-path-sum/一棵二叉树,每个节点上都标有数值,寻找一条路径,使得路径上所有节点的值和最大。样例:输入 1 / \ 2 3输出6原创 2015-09-02 15:52:14 · 2349 阅读 · 0 评论 -
LeetCode 129: Sum Root to Leaf Numbers 树的遍历
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.原创 2015-09-07 20:29:04 · 1084 阅读 · 0 评论 -
LeetCode 89: Gray Code 格雷码
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A原创 2015-09-07 21:17:14 · 1107 阅读 · 0 评论