码迷,mamicode.com
首页 >  
搜索关键字:bst    ( 4557个结果
[LeetCode] Convert Sorted List to Binary Search Tree DFS,深度搜索
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.Hide TagsDepth-first SearchLinked List 这....
分类:其他好文   时间:2015-01-15 21:47:04    阅读次数:171
[leetcode]99 Recover Binary Search Tree
问题描述: 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 pretty straight forward. Could you...
分类:其他好文   时间:2015-01-15 20:18:55    阅读次数:137
[leetcode] Binary Search Tree Iterator
Binary Search Tree IteratorImplement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callin...
分类:其他好文   时间:2015-01-15 15:48:15    阅读次数:135
[leetcode] 98 Validate Binary Search Tree
问题描述: 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 nodes with keys less than the node'...
分类:其他好文   时间:2015-01-14 22:53:40    阅读次数:179
[Leetcode]Unique Binary Search Trees
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-01-14 22:37:54    阅读次数:241
[C++]LeetCode: 93 Binary Search Tree Iterator (经典题,非递归的中序遍历)
题目: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the next smallest number in the BST. Note:...
分类:编程语言   时间:2015-01-14 18:01:28    阅读次数:182
LeetCode--Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. For example: Given the below binary tree and sum ...
分类:其他好文   时间:2015-01-14 16:58:45    阅读次数:167
[C++]LeetCode: 92 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 ...
分类:编程语言   时间:2015-01-14 16:58:27    阅读次数:222
LeetCode--Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 / ...
分类:其他好文   时间:2015-01-14 16:55:08    阅读次数:202
LeetCode--Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree {3,9,20,#,#,15,7}, ...
分类:其他好文   时间:2015-01-14 15:36:13    阅读次数:127
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!