码迷,mamicode.com
首页 >  
搜索关键字:leaf    ( 924个结果
leetCode 112.Path Sum (路径和) 解题思路和方法
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 given sum. For example: Given the below binary tree and sum ...
分类:其他好文   时间:2015-08-05 15:00:34    阅读次数:112
*Binary Tree Level Order Traversal II
题目:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For ...
分类:其他好文   时间:2015-08-05 12:08:47    阅读次数:92
*Path Sum II
题目:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsu...
分类:其他好文   时间:2015-08-05 06:38:24    阅读次数:95
【暑假】根据in_order与post_order构树
TreeTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %lluSubmit Status DescriptionYou are to determine the value of the leaf node in a g...
分类:其他好文   时间:2015-08-04 18:34:11    阅读次数:99
Leetcode-107(Java) Binary Tree Level Order Traversal II
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:编程语言   时间:2015-08-03 16:44:18    阅读次数:162
Sum Root to Leaf Numbers
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:其他好文   时间:2015-08-02 23:12:12    阅读次数:219
打印二叉树两个叶子节点间的路径
简要代码 /* * File : print binary tree road between leaf A and leaf B * Date : 2015/8/2 * Author : jinya * Assert A --> B * traverse root , left , right ; left , root , right ; left , right , root...
分类:其他好文   时间:2015-08-02 16:54:43    阅读次数:138
Path Sum
题目: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 given sum...
分类:其他好文   时间:2015-08-02 08:50:43    阅读次数:91
Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:其他好文   时间:2015-08-01 23:27:33    阅读次数:114
leetCode 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 leaf node. 思路:很基础的一个题,DFS即可。代码如下: /** * Defin...
分类:其他好文   时间:2015-08-01 22:08:25    阅读次数:140
924条   上一页 1 ... 47 48 49 50 51 ... 93 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!