- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 leetcode 257. Binary Tree Paths
/*leetcode 257. Binary Tree PathsGiven a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1/ \2 3\ 5All root-to-leaf paths are:["1->2->5", "1->3"]题
2017-02-24 10:53:18 313
原创 leetcode 101. Symmetric Tree
/*leetcode 101. Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric:1/ \2 2/ \ /
2017-02-23 10:52:55 239
原创 leetcode 112. Path Sum
TreeInclude.h:测试用#ifndef _TREE_INCLUDE_H_ #define _TREE_INCLUDE_H_#include <iostream>#include <vector>#include <algorithm>#include <string>using namespace std;// 节点数据结构struct TreeNode{ int va
2017-02-23 10:22:54 198
原创 leetcode 111. Minimum Depth of Binary Tree
头文件在http://blog.csdn.net/charles1e/article/details/56479700/*leetcode 111. Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the
2017-02-22 19:51:43 248
原创 leetcode 110. Balanced Binary Tree
头文件在http://blog.csdn.net/charles1e/article/details/56479700/*leetcode 110. Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree
2017-02-22 18:54:07 270
原创 leetcode 404. Sum of Left Leaves
/*leetcode 404. Sum of Left LeavesFind the sum of all left leaves in a given binary tree.题目大意:求二叉树左叶子节点之和解题思路:1. 递归,遇到左叶子节点就求和2. BFS。*/#include "TreeInclude.h"#include <queue>class Solution1 {p
2017-02-22 16:42:14 207
原创 leetcode 107. Binary Tree Level Order Traversal II
头文件在http://blog.csdn.net/charles1e/article/details/56479700/*leetcode 107. Binary Tree Level Order Traversal IIGiven a binary tree, return the bottom-up level order traversal of its nodes' values. (ie
2017-02-22 15:55:51 260
原创 leetcode 501. Find Mode in Binary Search Tree
头文件说明:该头文件为一些简单是二叉树操作,提交leetcode时不需要,只是为了本地测试而已~#ifndef _TREE_INCLUDE_H_ #define _TREE_INCLUDE_H_#include <iostream>#include <vector>#include <algorithm>#include <string>using namespace std;// 节点数据
2017-02-22 09:53:03 609
原创 leetcode 327. Count of Range Sum
/*leetcode 327. Count of Range SumGiven an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the elements in nums bet
2017-02-21 21:09:43 469
原创 leetcode 315. Count of Smaller Numbers After Self
/*leetcode 315. Count of Smaller Numbers After SelfYou are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of sm
2017-02-14 11:28:02 277
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人