1 There is a tree in the box at the top of this section What
1) There is a tree in the box at the top of this section. What is the order of nodes visited using a pre-order traversal?
A. 1 2 3 7 10 11 14 30 40
B. 1 2 3 14 7 10 11 40 30
C. 1 3 2 7 10 40 30 11 14
D. 14 2 1 3 11 10 7 30 40
2) There is a tree in the box at the top of this section. What is the order of nodes visited using an in-order traversal?
A. 1 2 3 7 10 11 14 30 40
B. 1 2 3 14 7 10 11 40 30
C. 1 3 2 7 10 40 30 11 14
D. 14 2 1 3 11 10 7 30 40
3) There is a tree in the box at the top of this section. What is the order of nodes visited using a post-order traversal?
A. 1 2 3 7 10 11 14 30 40
B. 1 2 3 14 7 10 11 40 30
C. 1 3 2 7 10 40 30 11 14
D. 14 2 1 3 11 10 7 30 40
4) There is a tree in the box at the top of this section. How many leaves does it have?
A. 2
B. 4
C. 6
D. 8
E. 9
5) There is a tree in the box at the top of this section. How many of the nodes have at least one sibling?
A. 5
B. 6
C. 7
D. 8
E. 9
6) There is a tree in the box at the top of this section. What is the value stored in the parent node of the node containing 30?
A. 10
B. 11
C. 14
D. 40
E. None of the above
7) There is a tree in the box at the top of this section. How many descendants does the root have?
A. 0
B. 2
C. 4
D. 8
8) There is a tree in the box at the top of this section. What is the depth of the tree?
A. 2
B. 3
C. 4
D. 8
E. 9
9) There is a tree in the box at the top of this section. How many children does the root have?
A. 2
B. 4
C. 6
D. 8
E. 9
10) Consider the binary tree in the box at the top of this section. Which statement is correct?
A. The tree is neither complete nor full.
B. The tree is complete but not full.
C. The tree is full but not complete.
D. The tree is both full and complete.
11) What is the minimum number of nodes in a full binary tree with depth 3?
A. 3
B. 4
C. 8
D. 11
E. 15
12) What is the minimum number of nodes in a complete binary tree with depth 3?
A. 3
B. 4
C. 8
D. 11
E. 15
13) Select the one true statement.
A. Every binary tree is either complete or full.
B. Every complete binary tree is also a full binary tree.
C. Every full binary tree is also a complete binary tree.
D. No binary tree is both complete and full.
14) Suppose T is a binary tree with 14 nodes. What is the minimum possible depth of T?
A. 0
B. 3
C. 4
D. 5
15) Select the one FALSE statement about binary trees:
A. Every binary tree has at least one node.
B. Every non-empty tree has exactly one root node.
C. Every node has at most two children.
D. Every non-root node has exactly one parent.
16) Consider the binary_tree_node from Section 10.3. Which expression indicates that t represents an empty tree?
A. (t == NULL)
B. (t->data( ) == 0)
C. (t->data( ) == NULL)
D. ((t->left( ) == NULL) && (t->right( ) == NULL))
17) Consider the node of a complete binary tree whose value is stored in data[i] for an array implementation. If this node has a right child, where will the right child\'s value be stored?
A. data[i+1]
B. data[i+2]
C. data[2*i + 1]
D. data[2*i + 2]
18) How many recursive calls usually occur in the implementation of the tree_clear function for a binary tree?
A. 0
B. 1
C. 2
19) Suppose that a binary taxonomy tree includes 8 animals. What is the minimum number of NONLEAF nodes in the tree?
A. 1
B. 3
C. 5
D. 7
E. 8
20) Consider this binary search tree:
Suppose we remove the root, replacing it with something from the left subtree. What will be the new root?
A. 1
B. 2
C. 4
D. 5
E. 16
Solution
1) There is a tree in the box at the top of this section. What is the order of nodes visited using a pre-order traversal?
Naswer:- A. 1 2 3 7 10 11 14 30 40
2) There is a tree in the box at the top of this section. What is the order of nodes visited using an in-order traversal?
Answer:- C. 1 3 2 7 10 40 30 11 14
3) There is a tree in the box at the top of this section. What is the order of nodes visited using a post-order traversal?
Answer:- D. 14 2 1 3 11 10 7 30 40
4) There is a tree in the box at the top of this section. How many leaves does it have?
Answer:- A. 2
5) There is a tree in the box at the top of this section. How many of the nodes have at least one sibling?
Answer:- D. 7




