码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
Efficiently traversing InnoDB B+Trees with the page directory--slot
Efficientlytraversing InnoDB B+Trees with the page directory 1、the purpose of the page directory As described in the posts mentioned above,all records in INDEX pages are linked together in a singl...
分类:数据库   时间:2015-07-03 23:27:10    阅读次数:213
LeetCode Binary Tree Level Order Traversal II (二叉树颠倒层序)
题意:从左到右统计将同一层的值放在同一个容器vector中,要求上下颠倒,左右不颠倒。思路:广搜逐层添加进来,最后再反转。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5...
分类:其他好文   时间:2015-07-03 23:19:55    阅读次数:139
Minimum Depth of Binary Tree
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2015-07-03 22:09:52    阅读次数:127
LeetCode Invert Binary Tree 反转二叉树
思路:递归解决,在返回root前保证该点的两个孩子已经互换了。注意可能给一个Null。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 * TreeNode *...
分类:其他好文   时间:2015-07-03 22:00:31    阅读次数:232
Binary Tree Level Order Traversal II
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2015-07-03 19:17:57    阅读次数:134
Balanced Binary Tree
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class...
分类:其他好文   时间:2015-07-03 19:14:07    阅读次数:124
LeetCode练习-求二叉树的深度-Maximu Depth of Binary Tree
题目大意:很简单,只需要找出一颗二叉树的最大深度即可,貌似没有时间和空间的要求。求解方法:更简单,只需要按照宽度优先的方法去查找即可,在这里我用a队列保存待扩展的节点,用b来保存a扩展出来的节点,再利用t中间变量来交换a和b,直到a列队为空时,结束。 注意边界条件,root=NULL时,应该返回0...
分类:其他好文   时间:2015-07-03 19:14:06    阅读次数:110
地图索引 R-tree
http://blog.csdn.net/v_JULY_v/article/details/6530142984年,加州大学伯克利分校的Guttman发表了一篇题为“R-trees: a dynamic index structure for spatial searching”的论文,向世人介绍了...
分类:其他好文   时间:2015-07-03 19:04:57    阅读次数:120
leetcode | Path Sum
Path Sum :https://leetcode.com/problems/path-sum/ 解析:求根到叶节点路径上所有节点的和等于target的值 即判断是否存在 一个叶节点的值等于target;如何判断一个节点是叶节点:该节点本身非空,左右节点为空。/** * Definition for a binary tree node. * struct TreeNode { *...
分类:其他好文   时间:2015-07-03 17:33:57    阅读次数:109
leetcode | Balanced Binary Tree
Balanced Binary Tree : https://leetcode.com/problems/balanced-binary-tree/given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary...
分类:其他好文   时间:2015-07-03 15:51:33    阅读次数:118
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!