12. binary search Trees The search tree data structure supports many dynamic-set operations,including search ,minimum,maximum,predecessor,successor ,i...
分类:
其他好文 时间:
2015-05-01 23:45:21
阅读次数:
263
Given inorder and postorder traversal of a tree, construct the binary tree.Note:
You may assume that duplicates do not exist in the tree....
分类:
其他好文 时间:
2015-05-01 20:00:19
阅读次数:
188
Quasi Binary
Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
A number is called quasibinary if its decimal representation contai...
分类:
其他好文 时间:
2015-05-01 17:27:06
阅读次数:
136
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 of the two subtrees of every node never differ by more than 1....
分类:
其他好文 时间:
2015-05-01 17:25:28
阅读次数:
115
做了vijos 1132之后做这题轻松多了,稍微调试了下就ac了,关键就是通过递归去找节点
前+中->后
#include
#include
#define maxn 1000+5
using namespace std;
int n;
int qi[maxn],zh[maxn];
int t=0;
struct root
{
int num;
root *left,*right;
};
...
分类:
其他好文 时间:
2015-05-01 16:09:40
阅读次数:
169
Gray CodeTotal Accepted:32175Total Submissions:98703My SubmissionsQuestionSolutionThe gray code is a binary numeral system where two successive values...
分类:
其他好文 时间:
2015-05-01 14:45:01
阅读次数:
188
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.....
分类:
其他好文 时间:
2015-05-01 14:40:44
阅读次数:
125
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
题意:求树的高度。
思路:就是递归。
/**
* Definiti...
分类:
其他好文 时间:
2015-05-01 12:06:48
阅读次数:
163
Latest SQLite binary for January 2015Well I went through quite a few threads to find an updated, decent sqlite binary. Didn't find any that met that c...
分类:
数据库 时间:
2015-05-01 00:33:10
阅读次数:
212
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2015-04-30 19:47:36
阅读次数:
107