码迷,mamicode.com
首页 >  
搜索关键字:binary tree upside d    ( 23249个结果)
Binary Tree Preorder Traversal
二叉树前序遍历非递归实现。...
分类:其他好文   时间:2014-09-01 22:49:43    阅读次数:181
LeetCode: Scramble String
LeetCode: Scramble StringGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is o...
分类:其他好文   时间:2014-09-01 22:42:34    阅读次数:308
LeetCode: Gray Code
LeetCode: Gray CodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n represen...
分类:其他好文   时间:2014-09-01 22:31:13    阅读次数:289
TreeSegment2104_DivideTree
给出一数组a,然后要求查询a[i..j]的第k大的数划分树#include#include#includeusingnamespacestd;constintN=100005;structNode{intl,r;intmid(){return(l+r)>>1;}}tree[Nmidval){val[...
分类:其他好文   时间:2014-09-01 22:30:23    阅读次数:309
Binary Tree Postorder Traversal 二叉树的后序遍历
二叉树的递归和非递归后序遍历总结。...
分类:其他好文   时间:2014-09-01 21:16:03    阅读次数:247
在fl2440开发板上移植第三方程序lrzsz,tree
在fl2440开发板上移植第三方程序lrzsz,tree
分类:其他好文   时间:2014-09-01 21:03:53    阅读次数:375
LRTHW笔记六
源码ex6-2.rb :types_of_people = 10x = "There are #{types_of_people} types of people." binary = "binary"do_not = "don't"y = "Those who know '#{binary}...
分类:其他好文   时间:2014-09-01 17:32:43    阅读次数:171
Same Tree
问题描述 Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the nodes have the same value. 解决...
分类:其他好文   时间:2014-09-01 15:40:33    阅读次数:146
CF 383C Propagating tree [想法+树状数组]
题意: 给一棵树 给出两种操作: 1.在某个结点上加上一个值,在这个结点所有的儿子结点上减去这个值,在这个结点的所有孙子结点上加上这个值,在所有曾孙子结点上减去这个值,直到底。 2.查询某个结点上的值 分析: 把这个问题转化为树状数组的区间求和 样例经过dfs处理后如下,每个结点处理出了两个值l,r,层数1,2,3...,层数为奇数的属性为0,层数为偶数的属性为1 可以看到...
分类:其他好文   时间:2014-09-01 14:09:03    阅读次数:213
BZOJ 3669 NOI2014 魔法森林 SPFA
题目大意: 给定一个无向图,每条边有两个权值ai和bi,从1走到N,设路径上a权的最大值为A,b权的最大值为B,求A+B的最小值 首先这题如果只有一个权值就是水题无误……但是多了个权值之后我们就要好好考虑一下了 我们对a排序,枚举a,对于每一次枚举求b权最大值的最小值即可 跑M遍SPFA肯定超时无误 网上很多人写了LInk-Cut-Tree维护动态最小生成树 我的LCT没写明白 就去写了S...
分类:其他好文   时间:2014-09-01 14:06:53    阅读次数:1733
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!