码迷,mamicode.com
首页 >  
搜索关键字:leaf    ( 924个结果)
POJ 3352 Road Construction(添最少边构造边双连通图的结论)
题意:已知无向图,问添加最少的边使之成为边双连通图 思路:显然先缩点成一棵树,添加最少边使一棵树的边双连通 此处有结论:对于一棵树添加(1+leaf)>>1 条无向边就能构造成一个双连通图,构造方法显然(脑补一下 //216K 63MS C++ 1754B #include #include #include #include ...
分类:其他好文   时间:2015-04-24 09:09:05    阅读次数:118
leetcode || 107、Binary Tree Level Order Traversal II
problem: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree...
分类:其他好文   时间:2015-04-23 11:02:24    阅读次数:163
JAVA设计模式(10):结构型-组合模式(Composite)
先看看组合模式的定义吧:“将对象组合成树形结构以表示‘部分-整体’的层次结构。组合模式使得用户对单个对象和组合对象的使用具有一致性。” /** * 抽象组件 */ public interface Component { void operation(); } /** * 叶子组件 */ interface Leaf extends Component{ } /** * 容器...
分类:编程语言   时间:2015-04-22 18:09:40    阅读次数:140
Path Sum Total Accepted: 50216 Total Submissions: 168425
题目来自于leetcode https://leetcode.com/problems/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 ...
分类:其他好文   时间:2015-04-21 18:05:43    阅读次数:156
leetcode || 104、Maximum Depth of Binary Tree
problem: 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. Hide Tags  Tr...
分类:其他好文   时间:2015-04-21 11:20:10    阅读次数:108
Java:this示例
1 public class Leaf { 2 3 int i = 0; 4 5 Leaf inceament() { 6 i++; 7 return this; 8 } 9 10 void print() {11 ...
分类:编程语言   时间:2015-04-19 01:11:18    阅读次数:213
LeetCode (12) 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-04-18 22:01:55    阅读次数:136
LeetCode --- 107. Binary Tree Level Order Traversal II
题目链接:Binary Tree Level Order Traversal II Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For exam...
分类:其他好文   时间:2015-04-17 18:16:21    阅读次数:176
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.Fo...
分类:其他好文   时间:2015-04-17 08:21:12    阅读次数:101
LeetCode --- 104. Maximum Depth of Binary Tree
题目链接: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. 这道题...
分类:其他好文   时间:2015-04-16 10:25:57    阅读次数:123
共924条   上一页 1 ... 58 59 60 61 62 ... 93 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!