Description
Given an undirected weighted graph G, you should find one of spanning trees specified as follows.
The graph G is an ordered pair (V, E), where V is a set of vertices {v1,
v2, …, vn}...
分类:
其他好文 时间:
2014-07-27 11:48:33
阅读次数:
312
链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=453Time Limit:2 Seconds Memory Limit:65536 KBThere are a lot of trees in an area. A peas...
分类:
其他好文 时间:
2014-07-26 00:23:16
阅读次数:
351
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 BST's.
1 3 3 2 1
\...
分类:
编程语言 时间:
2014-07-24 11:35:42
阅读次数:
245
介绍还有一种平衡二叉树:红黑树(Red Black Tree),红黑树由Rudolf Bayer于1972年发明,当时被称为平衡二叉B树(symmetric binary B-trees),1978年被Leonidas J. Guibas和Robert Sedgewick改成一个比較摩登的名字:红黑...
分类:
其他好文 时间:
2014-07-23 15:16:46
阅读次数:
375
Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni...
分类:
其他好文 时间:
2014-07-22 22:42:33
阅读次数:
243
题目链接题意 : 给你每个柿子树的位置,给你已知长宽的矩形,让这个矩形包含最多的柿子树。输出数目思路 :数据不是很大,暴力一下就行,也可以用二维树状数组来做。 1 //2029 2 #include 3 #include 4 #include 5 6 using namespace std ...
分类:
其他好文 时间:
2014-07-22 22:41:34
阅读次数:
298
二叉树? 怒水~~注意一下查询与x值的对应关系就好~ 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main (){ 7 char s[1000]; 8 int a[10],b[10]; 9 ...
分类:
其他好文 时间:
2014-07-22 22:35:35
阅读次数:
185
本节,我们将对leetcode上有关DP问题的题目做一个汇总和分析。
1.题目来源
Interleaving String
动态规划 二叉树
Unique Binary Search Trees 动态规划
二叉树
Word Break 动态规划
N/A
Word Break II 动态规划
N/A
Palindrome Partitioning 动态规划
N/A
...
分类:
其他好文 时间:
2014-07-21 15:47:05
阅读次数:
232
本节,我们将对leetcode上有关DP问题的题目做一个汇总和分析。
1.题目来源
Interleaving String
动态规划 二叉树
Unique Binary Search Trees 动态规划
二叉树
Word Break 动态规划
N/A
Word Break II 动态规划
N/A
Palindrome Partitioning 动态规划
N/A
...
分类:
其他好文 时间:
2014-07-21 15:21:05
阅读次数:
189
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 an...
分类:
其他好文 时间:
2014-07-21 14:35:26
阅读次数:
206