Toggle navigation
编绘童年
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Problem1758--二叉树-新二叉树
1758: 二叉树-新二叉树
Time Limit:
1
Sec
Memory Limit:
128 MB
Submit:
124
Solved:
93
[
Status
] [
Submit
] [Creator:
]
Description
输入一串二叉树,输出其前序遍历。
Input
第一行为二叉树的结点数 n(1≤n≤26)。
后面 n 行,第一个字母为结点,后两个字母分别为其左右儿子。数据保证第一行读入的结点为'a',且必为根结点。
空结点用 '*' 表示。
Output
二叉树的前序遍历。
Sample Input
Copy
6 abc bdi cj* d** i** j**
Sample Output
Copy
abdicj
Source/Category
提高B