码迷,mamicode.com
首页 >  
搜索关键字:leaf    ( 924个结果
Binary Tree Paths
Given 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->...
分类:其他好文   时间:2015-08-25 15:55:02    阅读次数:106
LeetCode257 BinaryTreePaths(打印根节点到叶子节点的左右路径) Java题解
题目: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / 2 3 5 All root-to-leaf paths are: ["1->2->5", "1->3"] ...
分类:编程语言   时间:2015-08-20 22:38:02    阅读次数:259
[LeetCode] 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.Fo...
分类:其他好文   时间:2015-08-20 10:14:39    阅读次数:94
数据结构之树与二叉树(理论篇)
一、树 树的定义:树是n(n>=0)个结点的有限集。 对于任意一棵非空树:(1)有且仅有一个特定的结点称为根结点;(2)当n>1时,其余结点可分为m(m>0)个互不相交的有限集T1,T2,T3···,Tm,其中每一个集合本身又是一棵树,并且称为根的子树。 结点:树的结点包含一个数据元素及若干指向其子树的分支。 度(degree):结点拥有的子树数称为结点的度。 叶子(leaf):度为...
分类:其他好文   时间:2015-08-19 17:07:31    阅读次数:173
129 Sum Root to Leaf Numbers
129 Sum Root to Leaf Numbers链接:https://leetcode.com/problems/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...
分类:其他好文   时间:2015-08-19 07:08:42    阅读次数:176
LeetCode257——Binary Tree Paths
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / 2 3 5 All root-to-leaf paths are: ["1->2->5", "1->3"] 实现: ...
分类:其他好文   时间:2015-08-17 23:47:51    阅读次数:188
[LeetCode] Binary Tree Paths 二叉树路径
Given 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->...
分类:其他好文   时间:2015-08-17 23:34:41    阅读次数:110
leetcode:Binary Tree Paths
Binary Tree PathsGiven a binary tree, return all root-to-leaf paths.For example, given the following binary tree: All root-to-leaf paths are:[“1->2->5”, “1->3”]分析 深度搜索class Solution { public: v...
分类:其他好文   时间:2015-08-17 17:25:01    阅读次数:149
[LeetCode][JavaScript]Binary Tree Paths
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-lea...
分类:编程语言   时间:2015-08-17 01:00:42    阅读次数:139
【LeetCode】107 - 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-16 18:09:04    阅读次数:127
924条   上一页 1 ... 45 46 47 48 49 ... 93 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!