码迷,mamicode.com
首页 >  
搜索关键字:diameter    ( 91个结果
HDU 1392 Surround the Trees (凸包周长)
题目链接: "HDU 1392" Problem Description There are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he mu ...
分类:其他好文   时间:2019-08-17 00:46:44    阅读次数:87
[leetCode]543. 二叉树的直径
题目 给定一棵二叉树,你需要计算它的直径长度。一棵二叉树的直径长度是任意两个结点路径长度中的最大值。这条路径可能穿过根结点。 示例 : 给定二叉树 1 / \ 2 3 / \ 4 5 返回?3, 它的长度是路径 [4,2,1,3] 或者?[5,2,1,3]。 注意:两结点之间的路径长度是以它们之间边 ...
分类:其他好文   时间:2019-08-08 00:44:10    阅读次数:171
LED Decorative Light Manufacturer - Decorative Lighting: Functionality And Aesthetics
Whether it is for general ambient lighting, task lighting or accent lighting, the decorative lighting in the home is functional and aesthetic. The wel ...
分类:其他好文   时间:2019-06-19 12:25:56    阅读次数:124
【leetcode_easy】543. Diameter of Binary Tree
problem 543. Diameter of Binary Tree 参考 1. Leetcode_easy_543. Diameter of Binary Tree; 完 ...
分类:其他好文   时间:2019-05-29 14:33:24    阅读次数:129
543. Diameter of Binary Tree
一、题目 1、审题 2、分析 求一棵二叉树中两个节点最远的距离。 二、解答 ① 采用全局变量 max 记录两个节点之间最远的距离 ...
分类:其他好文   时间:2019-05-28 22:51:11    阅读次数:225
Codeforces Forethought Future Cup Elimination Round 选做
施工中。。。 1146C Tree Diameter 题意 交互题。有一棵 $n(n\le 100)$ 个点的树,你可以进行不超过 $9$ 次询问,每次询问两个点集中两个不在同一点集的点的最大距离。求树的直径。 题解 和 GXOI2019旅行者基本类似,二进制分组,对于每一位,编号当前位为 $0$ ...
分类:其他好文   时间:2019-04-22 21:06:59    阅读次数:247
14.Diameter of Binary Tree(二叉树的直径)
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the **longest** path b... ...
分类:其他好文   时间:2019-04-15 20:29:09    阅读次数:178
【Codeforces 1086B】Minimum Diameter Tree
【链接】 "我是链接,点我呀:)" 【题意】 题意 【题解】 统计叶子节点个数m 把每条和叶子节点相邻的边权设置成s/cnt就可以了 这样答案就是2 s/m(直径最后肯定是从一个叶子节点开始,到另外一个叶子节点结束) 证明: 设dis(i,j)表示节点i和节点j之间的权值和 设a[1],a[2].. ...
分类:其他好文   时间:2019-04-09 20:34:58    阅读次数:140
543. Diameter of Binary Tree(两节点的最长路径)
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe ...
分类:其他好文   时间:2019-03-20 11:44:09    阅读次数:150
LeetCode题解之Diameter of Binary Tree
1、题目描述 2、分析 深度优先。 3、代码 ...
分类:其他好文   时间:2019-02-28 13:14:54    阅读次数:158
91条   上一页 1 2 3 4 5 ... 10 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!