Problem2083--数据结构概论上机考试四-1095

2083: 数据结构概论上机考试四-1095

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 301  Solved: 56
[Submit] [Status] [Web Board] [Creator:]

Description

使用 扩展先序遍历序列创建一棵二叉树,并给出其中两个结点,请判断这两个结点之间的关系,是父子关系(Parent-child relationship),兄弟关系(Sibling relationship),祖先与后代关系(Ancestor-descendant relationship)或者没有直接关系(No direct relationship)等。要求用C语言的链表。

Input

二叉树的扩展先序遍历序列(其中#代表空结点) 任意两个结点的值

Output

这两个结点之间的关系

Sample Input Copy

ABD##E##CF##G##
D E

Sample Output Copy

Sibling relationship

Source/Category

423