Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-07-02 22:34:44
阅读次数:
318
Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1.....
分类:
其他好文 时间:
2014-07-02 22:13:23
阅读次数:
191
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =...
分类:
其他好文 时间:
2014-07-02 22:10:42
阅读次数:
262
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-07-02 21:13:05
阅读次数:
170
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
分类:
其他好文 时间:
2014-07-02 10:03:09
阅读次数:
175
今天碰到一个比较坑爹的问题,在centos上用yum安装编译环境,运行:
yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
结果导致编译cocos2d-x出现错误:
cc1plus: error: unrecognized command line option "-std=c++11"...
分类:
其他好文 时间:
2014-07-02 08:23:01
阅读次数:
290
(一)二分的模版:
int binary_search(int *array, int length, int key) {
int start = 0, end = length - 1;
while(end >= start) {
int middle = start + (end - start) / 2;
int tmp = array[middle];
if(tmp <...
分类:
其他好文 时间:
2014-07-02 08:19:05
阅读次数:
211
[LeetCode]Maximum Depth of Binary Tree...
分类:
其他好文 时间:
2014-07-02 08:09:01
阅读次数:
175
ERROR 1665 (HY000): Cannot executestatement: impossible to write to binary log since BINLOG_FORMAT = STATEMENTand at least one table uses a storage engine limited to row-based logging.InnoDB is limited to row-logging when transaction isolation level is REA...
分类:
数据库 时间:
2014-07-02 07:46:46
阅读次数:
322
判断一个二叉树是否是轴对称的是一个经典的算法问题,下面结合leetcode上的Symmetric Tree给出判断对称树的两种方法。
先看看问题描述:
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, t...
分类:
其他好文 时间:
2014-07-02 06:58:05
阅读次数:
208