码迷,mamicode.com
首页 >  
搜索关键字:minimal ratio tree    ( 19189个结果
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
centos 6.5 minimal 安装及vm-tools安装
安装vm-->注册vm-->新建一个虚拟机(选择等会安装系统)-->加载iso-->配置桥接-->启动这里可能碰到一个cpu的虚拟化配置,需要在bios里的配置设置为enable我安装的是centos的minimal,无桌面的最小化版本,需要自己启动网络功能配置网卡-->重启网络vi /etc/sy...
分类:其他好文   时间:2014-05-09 19:04:10    阅读次数:455
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
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
二叉树,添加,查找
public class Tree { TreeNode last = null; TreeNode root = null; public Tree(int value){ root = createNode(value); } ...
分类:其他好文   时间:2014-05-07 18:45:42    阅读次数:275
PHP图片裁剪函数(图像不变形)
PHP图片裁剪函数(图像不变形) 1 && $ratio_h > 1)) {if($ratio_w 1) || ($ratio_w >1 && $ratio_h $ratio_w? $ratio_h : $ratio_w; //取比例大的那个值// 定义一个中间的大图像,该图像的高或宽和目标图像相....
分类:Web程序   时间:2014-05-07 18:42:24    阅读次数:421
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, 1 ...
分类:其他好文   时间:2014-05-07 09:36:09    阅读次数:300
LeetCode OJ - Validate Binary Search Tree
验证二叉树是否是查找树,可以通过查看它的中序遍历是否是升序的。下面是AC代码: 1 /** 2 * Given a binary tree, determine if it is a valid binary search tree (BST). 3 * solution : 4...
分类:其他好文   时间:2014-05-07 09:01:45    阅读次数:250
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!