百度之星2017 资格赛1003
摘要:#include <cstdio>#include <cstring>#include <cmath>#include <map>#include <set>#include <iostream>#include <algorithm>#include <string>using namespace
阅读全文
posted @
2017-08-09 21:12
王早
阅读(107)
推荐(0)
112. Path Sum 113. Path Sum II
摘要:回溯法的典型 1、Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the giv
阅读全文
posted @
2017-08-09 10:48
王早
阅读(132)
推荐(0)
104. Maximum Depth of Binary Tree
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l
阅读全文
posted @
2017-08-08 19:04
王早
阅读(104)
推荐(0)
515. Find Largest Value in Each Tree Row
摘要:You need to find the largest value in each row of a binary tree. Example: Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9] /** * Definition for a binary
阅读全文
posted @
2017-08-02 16:14
王早
阅读(127)
推荐(0)
Leetcode 623. Add One Row to Tree
摘要:Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth
阅读全文
posted @
2017-08-01 17:32
王早
阅读(176)
推荐(0)
Leetcode 637. Average of Levels in Binary Tree
摘要:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: /** * Definition for a bi
阅读全文
posted @
2017-08-01 11:33
王早
阅读(174)
推荐(0)