码迷,mamicode.com
首页 >  
搜索关键字:binary tree    ( 23211个结果
【LeetCode】Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.1. 将LinkedList的值保存到一个数组中,转化成Convert Sorte...
分类:其他好文   时间:2014-05-12 05:53:09    阅读次数:367
[leetcode]Flatten Binary Tree to Linked List @ Python
原题地址:http://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/题意:Given a binary tree, flatten it to a linked list in-place.For example,Given...
分类:编程语言   时间:2014-05-12 05:30:32    阅读次数:367
[leetcode]Sum Root to Leaf Numbers @ Python
原题地址:http://oj.leetcode.com/problems/sum-root-to-leaf-numbers/题意:Given a binary tree containing digits from0-9only, each root-to-leaf path could repre...
分类:编程语言   时间:2014-05-12 01:28:30    阅读次数:440
脑洞大开加偏执人格——可持久化treap版的Link Cut Tree
一直没有点动态树这个科技树,因为听说只能用Splay,用Treap的话多一个log。有一天脑洞大开,想到也许Treap也能从底向上Split。仔细思考了一下,发现翻转标记不好写,再仔细思考了一下,发现还是可以写的,只需要实时交换答案二元组里的两棵树,最后在吧提出来的访问节点放回去就行了。本着只学.....
分类:其他好文   时间:2014-05-11 22:56:42    阅读次数:605
SPOJ 4487. Can you answer these queries VI splay
题目链接:点击打开链接 题意比较明显,不赘述。 删除时可以把i-1转到根,把i+1转到根下 则i点就在 根右子树 的左子树,且只有i这一个 点 #include #include #include #include using namespace std; #define N 300500 #define inf 10000000 #define L(x) tree[x].ch[0] #d...
分类:其他好文   时间:2014-05-11 21:05:52    阅读次数:365
【LeetCode】Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:其他好文   时间:2014-05-11 06:46:32    阅读次数:366
[有向树的最小表示] poj 1635 Subway tree systems
题目链接: http://poj.org/problem?id=1635 题目意思: 判断两棵树是否为同构的。0...
分类:其他好文   时间:2014-05-11 05:37:16    阅读次数:338
[LeetCode]Binary Tree Maximum Path Sum, 解题报告
题目 Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree,...
分类:其他好文   时间:2014-05-11 03:25:24    阅读次数:298
Leetcode 树 Maximum Depth of Binary Tree
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Maximum Depth of Binary Tree  Total Accepted: 16605 Total Submissions: 38287 Given a binary tree, find its maximum depth. ...
分类:其他好文   时间:2014-05-11 01:58:31    阅读次数:441
Linux RPM管理
RPM是RedHat Package Manager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序”rpm 执行安装包 二进制包(Binary)以及源代码包(Source)两种。二进制包可以直接安装在计算机中,而源代码包将会由RPM自动编译、安装。源代码包经常以src.rpm...
分类:系统相关   时间:2014-05-11 00:55:18    阅读次数:489
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!