摘要:
#include<bits/stdc++.h> using namespace std; vector<int> pre,post,in; void toPost(int root,int inL,int inR){ if(inL>inR){ return ; } // int k=inL; int 阅读全文
摘要:
Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operat 阅读全文
摘要:
假设二叉树中的所有键都是不同的正整数。可以通过给定的一对后序遍历和有序遍历序列来确定唯一的二叉树。这是一个简单的标准例程,可以按级别顺序打印数字。但是,如果您认为问题太简单了,那就太天真了。这次,您应该按“曲折顺序”打印数字-也就是说,从根开始,逐级打印数字,从左到右和从右到左交替。例如,对于以下树 阅读全文
摘要:
Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th 阅读全文
摘要:
The following is from Max Howell @twitter: Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a 阅读全文
摘要:
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文
摘要:
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and ino 阅读全文
摘要:
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes 阅读全文