https://oj.leetcode.com/problems/validate-binary-search-tree/Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is ...
分类:
其他好文 时间:
2015-02-27 21:24:37
阅读次数:
143
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes w...
分类:
其他好文 时间:
2015-02-26 21:32:47
阅读次数:
191
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解法:自底向上 时间复杂度O(n), 空间复杂度O(logN) 1 clas...
分类:
其他好文 时间:
2015-02-26 19:58:04
阅读次数:
166
https://oj.leetcode.com/problems/binary-search-tree-iterator/Implement an iterator over a binary search tree (BST). Your iterator will be initialized ...
分类:
其他好文 时间:
2015-02-26 18:22:37
阅读次数:
206
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-02-25 15:32:26
阅读次数:
109
标题Validate Binary Search Tree通过率21.9%难度中等Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:T...
分类:
其他好文 时间:
2015-02-25 12:52:41
阅读次数:
144
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 n...
分类:
其他好文 时间:
2015-02-24 06:55:58
阅读次数:
171
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 ...
分类:
其他好文 时间:
2015-02-23 15:26:34
阅读次数:
168
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-02-19 16:19:37
阅读次数:
157
水。。。 1 /************************************************************** 2 Problem: 1012 3 User: idy002 4 Language: C++ 5 Result: A...
分类:
其他好文 时间:
2015-02-19 16:15:53
阅读次数:
147