/************************************************************************/ /* 40: Binary Tree Preorder Traversal */ /*****************************...
分类:
其他好文 时间:
2015-01-27 23:16:12
阅读次数:
244
/************************************************************************/ /* 32: Binary Tree Level Order Traversal */ /***************************...
分类:
其他好文 时间:
2015-01-27 23:06:35
阅读次数:
159
Details not refined yet..struct Ret{ Ret(TreeNode *p, Mask rm) : pVal(p), m(rm){} TreeNode *pVal; Mask m;};class Solution {public: Ret lca...
分类:
其他好文 时间:
2015-01-27 07:03:07
阅读次数:
193
Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [3,2,...
分类:
其他好文 时间:
2015-01-27 01:51:12
阅读次数:
198
传送门:https://oj.leetcode.com/problems/binary-tree-level-order-traversal/Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, ...
分类:
其他好文 时间:
2015-01-21 13:22:25
阅读次数:
151
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42876657
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: Re...
分类:
其他好文 时间:
2015-01-19 21:11:04
阅读次数:
184
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42876699
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Re...
分类:
其他好文 时间:
2015-01-19 21:09:52
阅读次数:
145
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/42876769
Given a binary tree, return the postorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [3,2,1].
Note: ...
分类:
其他好文 时间:
2015-01-19 21:09:14
阅读次数:
152
原题地址递归写法谁都会,看看非递归写法。对于二叉树的前序和中序遍历的非递归写法都很简单,只需要一个最普通的栈即可实现,唯独后续遍历有点麻烦,如果不借助额外变量没法记住究竟遍历了几个儿子。所以,最直接的想法就是在栈中记录到底遍历了几个儿子。代码: 1 vector postorderTraversal...
分类:
其他好文 时间:
2015-01-19 18:40:29
阅读次数:
116
标题:Binary Tree Level Order Traversal II通过率:30.5%难度:简单Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from lef...
分类:
其他好文 时间:
2015-01-18 13:02:13
阅读次数:
151