码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
leetcode-Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. class Solution { private: TreeNode *root; v...
分类:其他好文   时间:2015-01-02 09:46:36    阅读次数:107
[LeetCode]145 Binary Tree Postorder Traversal
https://oj.leetcode.com/problems/binary-tree-postorder-traversal/http://blog.csdn.net/ljphhj/article/details/21369053/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassSolution..
分类:其他好文   时间:2015-01-02 07:33:36    阅读次数:132
[LeetCode]113 Binary Tree Postorder Traversal
https://oj.leetcode.com/problems/path-sum-ii/http://fisherlei.blogspot.com/search?q=Path+Sum+II+/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassSolution{ publicList<List&..
分类:其他好文   时间:2015-01-02 07:33:25    阅读次数:151
[leetcode] Scramble string
题目:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representat...
分类:其他好文   时间:2015-01-02 06:29:15    阅读次数:197
[leetcode] Unique Binary Search Trees
题目:(DP)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...
分类:其他好文   时间:2015-01-02 06:24:14    阅读次数:195
[LeetCode]112.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 tre...
分类:其他好文   时间:2015-01-01 23:49:22    阅读次数:189
[LeetCode]129.Sum Root to Leaf Numbers
【题目】 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Fin...
分类:其他好文   时间:2015-01-01 22:33:42    阅读次数:208
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-01 17:16:17    阅读次数:530
【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-01 17:11:34    阅读次数:202
[leetcode] Binary Tree Postorder Traversal
题目:(Tree ,Stack)Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3...
分类:其他好文   时间:2015-01-01 07:54:28    阅读次数:116
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!