原题地址:http://oj.leetcode.com/problems/balanced-binary-tree/题意:判断一颗二叉树是否是平衡二叉树。解题思路:在这道题里,平衡二叉树的定义是二叉树的任意节点的两颗子树之间的高度差小于等于1。这实际上是AVL树的定义。首先要写一个计算二叉树高度的函...
分类:
编程语言 时间:
2014-05-12 14:51:47
阅读次数:
304
原题地址:http://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/题意:根据二叉树的先序遍历和中序遍历恢复二叉树。解题思路:可以参照http://www.cnblogs.com...
分类:
编程语言 时间:
2014-05-12 14:24:57
阅读次数:
324
原题地址:http://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/题意:根据二叉树的中序遍历和后序遍历恢复二叉树。解题思路:看到树首先想到要用递归来解题。以这道题为例:如果一...
分类:
编程语言 时间:
2014-05-12 14:09:28
阅读次数:
321
题目描述There is a grid size of 1*N. The spanning tree
of the grid connects all the vertices of the grid only with the edges of the
grid, and every vertex...
分类:
其他好文 时间:
2014-05-10 19:00:03
阅读次数:
337
很简单的题目,一次过,注意为数组空的时候,应返回0而非null 1 public class
Solution { 2 public int searchInsert(int[] A, int target) { 3 int i; 4 if
(A.length...
分类:
其他好文 时间:
2014-05-10 06:51:21
阅读次数:
288
现在你已经简单了解了ES能帮你做什么,也了解了开始使用ES是多么的简单。ES尝试最少量的只是和配置就能达到目的。学习ES的最好的方式就是跳跃式阅读:在index和search处开始就可以了。然而,你对ES了解的越多,你就能获得越多的生产力,就越能发现应用程序特定域的元素,就越能调整输出。本书剩余的部...
分类:
其他好文 时间:
2014-05-10 06:30:27
阅读次数:
255
ComBoost项目地址http://comboost.wodsoft.comhttps://github.com/Kation/ComBoost/tree/develop准备工作首先,在Visual
Studio中创建Mvc4项目。然后使用NuGet安装ComBoost程序包。编写实体在Model...
分类:
Web程序 时间:
2014-05-10 05:53:57
阅读次数:
476
经常, 我们用通过这样的方法调用API。 NSString* urlString = [NSString stringWithFormat:@"http://api.douban.com/v2/movie/search?q=%@", content];
NSURL *url = [NSURL URLWithString:urlString];
testRequest...
分类:
移动开发 时间:
2014-05-10 04:51:21
阅读次数:
395
Problem DescriptionA tree is a well-known data
structure that is either empty (null, void, nothing) or is a set of one or more
nodes connected by dire...
分类:
其他好文 时间:
2014-05-10 03:18:52
阅读次数:
374
Recentlyifindthewindows8DiskUsagealwayskeepup100%,Itmustbehavesomeissue.Step1.GointoOpenTaskManagerStep2.GotoDetailstabStep3.Rightclickthecolumnsheadersandclick"SelectColumns"Step4.Fromthe"SelectColumns"window,check:I/OReads,I/OWrites,I/Oreadbytes,I/Owriteb..