码迷,mamicode.com
首页 >  
搜索关键字:traversal    ( 1649个结果
[leetcode]Construct Binary Tree from Preorder and Inorder Traversal
Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume...
分类:其他好文   时间:2014-07-31 23:26:10    阅读次数:318
[leetcode]Construct Binary Tree from Inorder and Postorder Traversal
Construct Binary Tree from Inorder and Postorder TraversalGiven inorder and postorder traversal of a tree, construct the binary tree.Note:You may assu...
分类:其他好文   时间:2014-07-31 23:26:00    阅读次数:286
Binary Tree Preorder Traversal
二叉树的前序遍历递归实现/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : v...
分类:其他好文   时间:2014-07-31 12:44:46    阅读次数:188
Binary Tree Postorder Traversal
二叉树的后序遍历递归实现/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : v...
分类:其他好文   时间:2014-07-31 12:30:16    阅读次数:224
Binary Tree Postorder Traversal leetcode java
题目:Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3...
分类:编程语言   时间:2014-07-30 11:33:23    阅读次数:258
Binary Tree Inorder Traversal leetcode java
题目:Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,3...
分类:编程语言   时间:2014-07-30 09:54:33    阅读次数:195
Binary Tree Preorder Traversal leetcode java
题目:Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,...
分类:编程语言   时间:2014-07-30 09:49:43    阅读次数:177
[LeetCode]Binary Tree Level Order Traversal II
[LeetCode]Binary Tree Level Order Traversal II...
分类:其他好文   时间:2014-07-29 14:42:48    阅读次数:145
二叉树的遍历及其Java实现
所谓遍历(Traversal)是指沿着某条搜索路线,依次对树中每个结点均做一次且仅做一次访问,对二叉树的遍历就是将非线性结构的二叉树中的节点排列在一个线性序列上的过程。访问结点所做的操作依赖于具体的应用问题。 遍历是二叉树上最重要的运算之一,是二叉树上进行其它运算之基础。 如果采用顺序结构来保存二叉树,遍历二叉树非常容易,直接遍历底层数组即可。如果采用链表来保存,则有以下两类遍历方式:...
分类:编程语言   时间:2014-07-29 12:54:47    阅读次数:241
Binary Tree Zigzag Level Order Traversal
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:其他好文   时间:2014-07-27 22:03:49    阅读次数:214
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!