PROGRAMMING:The structure of binary search tree
A binary search tree is either an empty tree or a binary tree with the following properties: if its left subtree is not empty, then the values of all nodes on the left subtree are less than the values of its root nodes; If its right subtree is not empty, then the values of all nodes on the right subtree are greater than the values of its root node; Its left and right subtrees are also binary search trees( From Baidu Encyclopedia)
Given a series of unequal integers, they are successively inserted into a binary search tree which is initially empty, and then the structure of the result tree is described. You need to be able to judge whether a given description is correct. For example, after inserting {24130} into a binary search tree, statements such as "2 is the root of the tree", "1 and 4 are brother nodes", "3 and 0 are on the same layer" (meaning the same depth from top to bottom), "2 is the parent node of 4" and "3 is the left child of 4" are correct; "4 is the left child of 2" and "1 and 3 are brother nodes" are not correct.
###Input format:
Enter a positive integer $$n $$($$Le 100 $$) in the first line, and $$n $$different integers in the next line, separated by spaces, which are required to be inserted into a binary search tree with an initial empty. After that, a positive integer $$M $$($$Le 100 $$) is given, followed by $$M $$lines, and each line gives a statement to be judged. There are six kinds of declarative sentences
-A is the root;
-A and B are siblings;
-"A is the parent of B", that is, "a is the parent of B";
-"A is the left child of B";
-"A is the right child of B";
-A and B are on the same level.
The topic guarantees that all given integers are in the range of integers.
###Output format:
For each statement, if it is correct, output 'yes'. Otherwise, output' no '. Each statement occupies one line.
###Input example:
```in
five
2 4 1 3 0
eight
2 is the root
1 and 4 are siblings
3 and 0 are on the same level
2 is the parent of 4
3 is the left child of 4
1 is the right child of 2
4 and 0 are on the same level
100 is the right child of 3
```
###Output example:
```out
Yes
Yes
Yes
Yes
Yes
No
No
No
```
answer:If there is no answer, please comment
Given a series of unequal integers, they are successively inserted into a binary search tree which is initially empty, and then the structure of the result tree is described. You need to be able to judge whether a given description is correct. For example, after inserting {24130} into a binary search tree, statements such as "2 is the root of the tree", "1 and 4 are brother nodes", "3 and 0 are on the same layer" (meaning the same depth from top to bottom), "2 is the parent node of 4" and "3 is the left child of 4" are correct; "4 is the left child of 2" and "1 and 3 are brother nodes" are not correct.
###Input format:
Enter a positive integer $$n $$($$Le 100 $$) in the first line, and $$n $$different integers in the next line, separated by spaces, which are required to be inserted into a binary search tree with an initial empty. After that, a positive integer $$M $$($$Le 100 $$) is given, followed by $$M $$lines, and each line gives a statement to be judged. There are six kinds of declarative sentences
-A is the root;
-A and B are siblings;
-"A is the parent of B", that is, "a is the parent of B";
-"A is the left child of B";
-"A is the right child of B";
-A and B are on the same level.
The topic guarantees that all given integers are in the range of integers.
###Output format:
For each statement, if it is correct, output 'yes'. Otherwise, output' no '. Each statement occupies one line.
###Input example:
```in
five
2 4 1 3 0
eight
2 is the root
1 and 4 are siblings
3 and 0 are on the same level
2 is the parent of 4
3 is the left child of 4
1 is the right child of 2
4 and 0 are on the same level
100 is the right child of 3
```
###Output example:
```out
Yes
Yes
Yes
Yes
Yes
No
No
No
```
answer:If there is no answer, please comment