Description
Background
Binary trees are a common data structure in computer science. In this problem we will look at an infinite binary tree where the nodes contain a pair of integers. Th...
分类:
其他好文 时间:
2014-08-01 19:39:52
阅读次数:
207
问题描述:
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
解题思路:...
分类:
其他好文 时间:
2014-08-01 13:48:11
阅读次数:
183
Problem Description
Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees...
分类:
其他好文 时间:
2014-08-01 10:54:28
阅读次数:
315
题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return....
分类:
编程语言 时间:
2014-08-01 04:53:31
阅读次数:
279
题目:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique B....
分类:
编程语言 时间:
2014-08-01 04:53:11
阅读次数:
272
Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ide...
分类:
其他好文 时间:
2014-07-31 23:15:00
阅读次数:
201
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identica....
分类:
编程语言 时间:
2014-07-31 02:24:15
阅读次数:
211
Hardwood SpeciesTime Limit: 10000MSMemory Limit: 65536KTotal Submissions: 18174Accepted: 7206DescriptionHardwoods are the botanical group of trees tha...
分类:
其他好文 时间:
2014-07-29 17:19:42
阅读次数:
215
class Solution {private: vector res;public: vector generateTrees(int n) { res.clear(); res = dfs(1, n + 1); return res; ...
分类:
其他好文 时间:
2014-07-27 23:28:19
阅读次数:
195
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 1000;
char s[maxn];
bool failed;
vector ans;
struct node
{
bool have_value;
int v;
node *left,*...
分类:
其他好文 时间:
2014-07-27 11:54:43
阅读次数:
198