码迷,mamicode.com
首页 >  
搜索关键字:inorder    ( 706个结果
[leetcode]
问题描述: Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 基本思路: 与前一篇《Construct Binary Tree from Preord...
分类:其他好文   时间:2014-11-23 11:51:28    阅读次数:172
[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. 基本思路: 找到规律,递归的解决左子树和右子树。 代码: /** * D...
分类:其他好文   时间:2014-11-23 10:32:58    阅读次数:190
[LeetCode]Binary Tree Inorder Traversal
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]. Note: Recursive solutio...
分类:其他好文   时间:2014-11-20 17:05:34    阅读次数:205
Binary Tree Inorder Traversal
Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:其他好文   时间:2014-11-17 22:36:09    阅读次数:271
[LeetCode]Binary Tree Inorder Traversal
【题目】 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]. Note: Recursi...
分类:其他好文   时间:2014-11-17 17:52:41    阅读次数:191
leetcode:Binary Tree Inorder Traversal
给一个二叉树,中序遍历这个树,输出得到的值...
分类:其他好文   时间:2014-11-17 00:32:33    阅读次数:167
LeetCode Construct Binary Tree from Inorder and Postorder Traversal
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.后序遍历的最后一个元素就是根...
分类:其他好文   时间:2014-11-11 00:40:07    阅读次数:189
HDU 1022 Train Problem I 模拟栈题解
火车进站,模拟一个栈的操作,额外的栈操作,查看能否依照规定顺序出栈。数据量非常少,故此题目非常easyAC。直接使用数组模拟就好。#include const int MAX_N = 10;char inOrder[MAX_N], outOrder[MAX_N], stk[MAX_N];bool r...
分类:其他好文   时间:2014-11-10 13:33:59    阅读次数:256
Construct a tree from Inorder and Level order traversals
Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem.BinaryTreeInpu...
分类:其他好文   时间:2014-11-09 20:41:07    阅读次数:196
Transform a BST to greater sum tree
Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater than that node.自己想的复杂了,其实就是一个反向的inorder。新的值就是前面所有元素的...
分类:其他好文   时间:2014-11-09 15:07:49    阅读次数:186
706条   上一页 1 ... 58 59 60 61 62 ... 71 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!