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 t...
分类:
其他好文 时间:
2015-04-03 01:35:34
阅读次数:
131
问题:判断二叉树是否为镜像二叉树分析:递归判断,根节点单独判断,然后递归左结点和右结点,之后每次一起递归左结点的左结点和右结点的右结点比较,左结点的右结点和右结点的左结点比较。 1 /** 2 * Definition for binary tree 3 * struct TreeNode { .....
分类:
其他好文 时间:
2015-04-03 00:11:45
阅读次数:
198
BCD:Binary Coded Decimal 即用4位二进制编码表示1位的十进制数.定义:BCD码这种编码形式利用了四个位元来储存一个十进制的数码,使二进制和十进制之间的转换得以快捷的进行。这种编码技巧,最常用于会计系统的设计里,因为会计制度经常需要对很长的数字串作准确的计算。相对于一般的浮点式...
分类:
其他好文 时间:
2015-04-02 23:52:34
阅读次数:
366
题目:
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: Recursive solution is trivial,...
分类:
其他好文 时间:
2015-04-02 22:39:03
阅读次数:
180
在ubuntu上安装eclipse后菜单点击不开,
解决方法:
关闭eclispe
cd /usr/share/applications
vi eclipse.destop
在文件末尾添加下面内容
Exec=env UBUNTU_MENUPROXY=0 /your/path/to/eclipse/binary...
分类:
系统相关 时间:
2015-04-02 20:59:40
阅读次数:
140
题目:
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 solution is trivial, c...
分类:
其他好文 时间:
2015-04-02 20:53:56
阅读次数:
141
class Solution {
public:
vector postorderTraversal(TreeNode *root) {
vector res;
stack>s;
TreeNode *p = root;
while(p!=NULL||!s.empty())
{
while...
分类:
其他好文 时间:
2015-04-02 19:02:48
阅读次数:
117
class Solution {
public:
vector preorderTraversal(TreeNode *root) {
vector res;
stack s;
TreeNode * p = root;
while(p!=NULL||!s.empty())
{
while...
分类:
其他好文 时间:
2015-04-02 19:02:38
阅读次数:
131
class Solution {
public:
vector inorderTraversal(TreeNode *root) {
vector res;
stack s;
TreeNode * p = root;
while(p!=NULL||!s.empty())
{
while(...
分类:
其他好文 时间:
2015-04-02 19:01:33
阅读次数:
98
Exec_Master_Log_Pos: The position of the last event executed by the SQL thread from the master's binary log (Relay_Master_Log_File). (Relay_Master_L.....
分类:
数据库 时间:
2015-04-02 18:31:50
阅读次数:
134