Given a binary tree, determine if it is
height-balanced.For this problem, a height-balanced binary tree is defined as a
binary tree in which the depth...
分类:
其他好文 时间:
2014-05-19 20:40:55
阅读次数:
278
使用TFHpple解析htmlhttps://github.com/topfunky/hpple前期准备工作引入静态库文件添加库文件的
header search paths(注意,必须选中 All)将从github上下载的源码包拖入工程当中准备工作结束使用详情我们来解析网址
http://www....
分类:
Web程序 时间:
2014-05-19 11:15:50
阅读次数:
581
题目链接:HDU 2795 Billboard【题意】给你一张h*w(1 7 #include
8 #include 9 using namespace std;10 const int MAX = 200005;11 12 int tree[MAX=
val)26 {27 ...
分类:
其他好文 时间:
2014-05-19 10:09:17
阅读次数:
419
Two elements of a binary search tree (BST) are
swapped by mistake.Recover the tree without changing its structure.Note:A
solution using O(n) space is ...
分类:
其他好文 时间:
2014-05-17 14:45:17
阅读次数:
290
第四道树题,逐渐能写递归了。虽然最后AC的代码还是看了网络,但是距离成功攻克此类问题仅一步之遥。题目:一棵树,判断是否为AVL。(AVL条件:树上任意一点的左右子树的高度差_
1 ) return false; else return isBalanced(root.lef...
分类:
其他好文 时间:
2014-05-16 04:04:41
阅读次数:
259
【Xcode迁移工程常见问题】1、Header Search Paths
(HEADER_SEARCH_PATHS) 是否设置正确。在Search Paths group下。 2、Framework Search Paths
(FRAMEWORK_SEARCH_PATHS) 是否设置正确。在Sea....
分类:
其他好文 时间:
2014-05-16 00:16:21
阅读次数:
370
原题:
题目解析:这个问题的实质是要我们按成访问二叉树的结点,并返回每层访问的结果,这里要求走Z字,其实就是一行正向一行反向。
/*
the kernel idea is visit a binary search tree in level and
the additional work we have to label the end of one level.
*/
v...
分类:
其他好文 时间:
2014-05-15 23:18:46
阅读次数:
515
裸题,瞬秒。。
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define L(id) tree[id].ch[0]
#define R(id) tree[id].ch[1]
#define Size(id) tree[id].size
#...
分类:
其他好文 时间:
2014-05-15 22:52:51
阅读次数:
328
Given two binary strings, return their sum
(also a binary string).For example, a = "11" b = "1" Return "100".string
的操作,短string补位。两个“0”会输出一个“00”,要特殊处理...
分类:
其他好文 时间:
2014-05-15 17:47:57
阅读次数:
283
第五道树题,10分钟之内一遍AC。做树题越来越有feel~题目:求一棵树从root结点到叶子结点的最短路径。思路:仍然是递归。如果一个结点的左右子树任意一边为Null,该子树的minDepth应为非null子树的高度+1;如果一个结点的左右子树两边都非Null,则该子树的minDepth应为两个子树...
分类:
其他好文 时间:
2014-05-15 17:24:43
阅读次数:
226