码迷,mamicode.com
首页 >  
搜索关键字:binary tree level or    ( 28941个结果
LeetCode OJ - Minimum && Maximum Depth of Binary Tree
这两道题用递归的解法都很简单,只是稍有不同。下面是AC代码: 1 /** 2 * Given a binary tree, find its minimum depth. 3 * the minimum depth is the number of nodes along th...
分类:其他好文   时间:2014-05-10 08:47:32    阅读次数:271
LeetCode OJ - construct Binary Tree from Inorder and Postorder/Preorder Traversal
不断递归的实现!!!!下面是AC代码: 1 /** 2 * Given inorder and postorder traversal of a tree, construct the binary tree. 3 * @param inorder 4 * @param...
分类:其他好文   时间:2014-05-10 08:40:40    阅读次数:297
Leetcode: Minimum Depth of Binary Tree
这道题因为不仔细的缘故两次过,与Maximum Depth of Binary Tree问题类似,区别在于这个问题中,如果一个节点左子树为空、右子树有值,则该节点的深度应取决于右子树,而不能直接取min{左,右} 1 /** 2 * Definition for binary tree 3 * .....
分类:其他好文   时间:2014-05-10 01:40:13    阅读次数:293
What is a heap?--reference
A heap is a partially sorted binary tree. Although a heap is not completely in order, it conforms to a sorting principle: every node has a value less ...
分类:其他好文   时间:2014-05-09 17:34:18    阅读次数:339
CentOS系统环境下安装MongoDB
原因:因为工作需要,集中管理log4j日志到MongoDB!进入MongoDB下载中心:http://www.mongodb.org/downloadsWe recommend using these binary distributions (官方推荐使用二进制版本!)根据自己的实际系统环境,下载...
分类:数据库   时间:2014-05-09 16:35:35    阅读次数:393
对oracle数字类型的研究
Oracle的数字类型主要有number,binary_float,binary_double三类,其他的像int,number(p,s)等等大多数都是由这些引申出来的。这部分的理解主要来自oracle11g编程艺术。 其中提到的一个很有意思的东西就是number是软件模拟运算,而binary...
分类:数据库   时间:2014-05-09 16:32:13    阅读次数:350
Leetcode: Path Sum
1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * TreeNode right; 7 * TreeNo...
分类:其他好文   时间:2014-05-09 12:16:45    阅读次数:232
EasyUI Tree与Datagrid联动
效果图这是一个简单的solr检索的例子 输入关键词,显示树 选择一个节点,得到该节点下文档信息 代码:JSP:重点是标红的URL传递 Carrot2: ...
分类:其他好文   时间:2014-05-09 11:31:09    阅读次数:567
Instant Django 1.5 Application Development Starter
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.Model: The application dataView: which data ...
分类:移动开发   时间:2014-05-07 20:02:08    阅读次数:453
LeetCode OJ - Convert Sorted Array/List to Binary Search Tree
Array和List的区别在于前者可以随机访问,而后者只能顺序访问。对于把排好序的array转成BST,可以用top-down的方式,很直观也很自然,时间复杂度是O(n)。而对于List如果采用同样的方式,每次需要顺序遍历到中间节点,时间复杂度变成O(nlogn),如果换一种思路,down-top,...
分类:其他好文   时间:2014-05-05 09:34:29    阅读次数:454
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!