码迷,mamicode.com
首页 >  
搜索关键字:inorder    ( 706个结果
[LeetCode] Recover Binary Search Tree
As the note in the problem statement, this problem has a straight-forward O(n)-space solution, which is to generate the inorder traversal results of t...
分类:其他好文   时间:2015-07-16 00:41:35    阅读次数:115
LeetCode94:Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, return [1,3,2].Note: Recursive solution is trivial, could you do it iteratively?二叉树的...
分类:其他好文   时间:2015-07-14 11:42:35    阅读次数:94
Binary Tree Inorder Traversal
https://leetcode.com/problems/binary-tree-inorder-traversal/递归中序遍历 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int v...
分类:其他好文   时间:2015-07-10 18:21:58    阅读次数:122
LeetCode之“树”:Binary Tree Preorder Traversal && Binary Tree Inorder Traversal && Binary Tree Postorder Traversal
Binary Tree Preorder Traversal 题目链接 题目要求: Given a binary tree, return thepreordertraversal of its nodes' values. For example: Given binary tree{1...
分类:其他好文   时间:2015-07-09 13:04:42    阅读次数:91
LeetCode94 BinaryTreeInorderTraversal Java题解(递归 迭代)
题目: Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,3,2]. 解题: 中序遍历一颗二叉树,如...
分类:编程语言   时间:2015-07-08 13:07:37    阅读次数:141
重建二叉树
既然已经分别找到了左、右子树的前序遍历序列和中序遍历序列,我们可用同样的方法分别去构建左右子树。所以,接下来的事情可用递归的方法去完成。 递归代码如下: BinaryTreeNode*  Construct(int* preorder, int *inorder, int length) { if (preorder == NULL || inorder == NULL || length...
分类:其他好文   时间:2015-07-02 22:36:19    阅读次数:256
LeetCode_Construct Binary Tree from Preorder and Inorder Traversal
LeetCode_Construct Binary Tree from Preorder and Inorder Traversal 解题思路...
分类:其他好文   时间:2015-06-29 20:27:59    阅读次数:76
LeetCode_Construct Binary Tree from Inorder and Postorder Traversal
LeetCode_Construct Binary Tree from Inorder and Postorder Traversal 解题思路...
分类:其他好文   时间:2015-06-29 20:26:47    阅读次数:82
leetCode(18):Construct Binary Tree from Preorder and Inorder (Inorder and Postorder) Traversal
Given preorder and inorder (Inorder and Postorder) traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree.        前序和后序的特点是根结点要么在最前面、要么在最后...
分类:其他好文   时间:2015-06-22 09:56:49    阅读次数:138
Construct Binary Tree from Inorder and Postorder Traversal
Description:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Co...
分类:其他好文   时间:2015-06-20 15:39:21    阅读次数:108
706条   上一页 1 ... 37 38 39 40 41 ... 71 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!