Problem Definition: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 equa...
分类:
其他好文 时间:
2015-07-21 21:55:17
阅读次数:
105
字符串类型
固定长度:char nchar n 表示Unicode编码
可变长度: varchar2 nvarchar2
数字类型:number(P,S)P:整数位数,S小数位数
integer 整数
BINARY_FLOAT 单浮点
BINARY_DOUBLE 双浮点
FLOAT...
分类:
数据库 时间:
2015-07-21 17:17:46
阅读次数:
135
Description
Little
Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.
This is an example of on...
分类:
其他好文 时间:
2015-07-21 17:09:30
阅读次数:
118
题目:
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
/ \ 3 4 6
The flattened tree should look like:
...
分类:
编程语言 时间:
2015-07-21 14:57:59
阅读次数:
131
题目大意:要求你将所有非障碍格子都走一遍,形成回路(可以多回路),问有多少种方法解题思路:
参考基于连通性状态压缩的动态规划问题 - 陈丹琦以下为代码#include
#include
#include
using namespace std;
#define N 12
#define S (1 << 12)
int n, m;
long l...
分类:
其他好文 时间:
2015-07-21 14:53:14
阅读次数:
93
题目:
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.
For example:
Given the below binary tree...
分类:
编程语言 时间:
2015-07-21 12:59:51
阅读次数:
120
题目:
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 and sum = 22,
5
/...
分类:
编程语言 时间:
2015-07-21 12:54:55
阅读次数:
127
题目:
Given a binary tree, find its minimum depth.
The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
题意:
给定一棵二叉树,返回它的最小高度。
最小高...
分类:
编程语言 时间:
2015-07-21 10:39:59
阅读次数:
132
题目:
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node...
分类:
编程语言 时间:
2015-07-20 23:48:33
阅读次数:
209
题目:
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
pretty straight forward. Could ...
分类:
编程语言 时间:
2015-07-20 23:47:29
阅读次数:
169