题目: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
题目: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
题目: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...
分类:
其他好文 时间:
2014-07-29 14:42:48
阅读次数:
145
所谓遍历(Traversal)是指沿着某条搜索路线,依次对树中每个结点均做一次且仅做一次访问,对二叉树的遍历就是将非线性结构的二叉树中的节点排列在一个线性序列上的过程。访问结点所做的操作依赖于具体的应用问题。 遍历是二叉树上最重要的运算之一,是二叉树上进行其它运算之基础。 如果采用顺序结构来保存二叉树,遍历二叉树非常容易,直接遍历底层数组即可。如果采用链表来保存,则有以下两类遍历方式:...
分类:
编程语言 时间:
2014-07-29 12:54:47
阅读次数:
241
/** * 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
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example: Given binary tree {3...
分类:
其他好文 时间:
2014-07-26 14:03:16
阅读次数:
174
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
比较简单,就是转化成中序遍历即可,访问顺序是中序遍历左子树,根节点,中序遍历右子树
Python编程的时候需要注意,要在返回单一数字的时候加...
分类:
编程语言 时间:
2014-07-25 11:07:51
阅读次数:
221
http://blog.csdn.net/mazidao2008/article/details/4934257————————————————————————————————————————————————————STUN简介STUN(Simple Traversal of UDP over NA...
分类:
其他好文 时间:
2014-07-24 21:33:22
阅读次数:
314
Another textbook problem. We take back of postorder array as the current root, and then we can split the inorder array: 1st half for current right chi...
分类:
其他好文 时间:
2014-07-23 12:01:56
阅读次数:
210