码迷,mamicode.com
首页 >  
搜索关键字:trees    ( 1351个结果
Unique Binary Search Trees II
[leetcode]Given n, generate all structurally unique BST's (binary search trees) that store values 1...n....
分类:其他好文   时间:2014-10-17 12:08:07    阅读次数:165
[Leetcode] Same Tree
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-10-16 08:40:12    阅读次数:131
[leetcode] Unique Binary Search Trees @ Python
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-10-16 00:30:31    阅读次数:210
HDU 1505 City Game(01矩阵 dp)
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,f...
分类:其他好文   时间:2014-10-14 23:03:49    阅读次数:178
Unique Binary Search Trees II
这题首先要明白的是,二叉搜索树的左子树和右子树都自成二叉搜索树。这种递归定义决定了,如果我知道从1到n - 1时,所有的二叉搜索树结构,那结点数为n的二叉搜索树也可以得到了。转换关系是这样的:对于一个含有n个结点的二叉搜索树,首先树根可以从i = 1~n变化,然后左右子树的结点数目分别是i - 1和...
分类:其他好文   时间:2014-10-13 23:02:57    阅读次数:176
2 Unique Binary Search Trees II_Leetcode
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 all ...
分类:其他好文   时间:2014-10-12 19:12:18    阅读次数:158
HDU 1710 Binary Tree Traversals
Problem Description A binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the left and right subtrees. There are three most impor...
分类:其他好文   时间:2014-10-09 16:32:58    阅读次数:176
Unique Binary Search Trees 三种解法 python
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-10-09 14:37:53    阅读次数:215
Unique Binary Search Trees
[leetcode]Given n, how many structurally unique BST's (binary search trees) that store values 1...n?...
分类:其他好文   时间:2014-10-08 12:00:15    阅读次数:159
leetcode - Unique Binary Search Trees II
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 all 5 unique BST's shown below. 1 3 ...
分类:其他好文   时间:2014-10-08 11:52:35    阅读次数:202
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!