Chapter 15
A descendant of node n is a node on a path from node n to ______. a. the root b. a leaf c. a sibling of node n d. a child of node n
B
A node on the path from the root to node n is a(n) ______ of node n. a. ancestor b. descendant c. subtree d. leaf
B
Each node in a tree has ______. a. exactly one parent b. at most one parent c. exactly one leaf d. at most two leaves
B
The lines between the nodes of a tree are called ______. a. branches b. edges c. arches d. subtrees
B
The maximum number of comparisons for a retrieval operation in a binary search tree is the ______. a. length of the tree b. height of the tree c. number of nodes in the tree d. number of leaves in the tree
B
The node of a tree that has no parent is called a(n) ______. a. edge b. root c. leaf d. vertex
B
The operations of the ADT sorted list are based upon the ______ of data items. a. names b. values c. sizes d. positions
B
A subtree of node n is a subtree rooted at ______. a. node n b. the parent of node n c. a child of node n d. a sibling of node n
A
Any data element within a record of a binary search tree is called a ______. a. field b. tree c. collection d. key
A
Locating a particular item in a binary search tree of n nodes requires at most ______ comparisons. a. n b. n / 2 c. (n / 2) - 2 d. log2(n + 1)
A
The ______ of a tree is the number of nodes on the longest path from the root to a leaf. a. height b. length c. depth d. balance
A
The maximum height of a binary tree of n nodes is ______. a. n b. n / 2 c. (n / 2) - 2 d. log2(n + 1)
A
The traversal of a binary tree is ______. a. O(n) b. O(1) c. O(n2) d. O(log2 n)
A
Which one of the following ADTs is position-oriented? a. binary tree b. sorted list c. table d. priority queue
A
1. The ADT ______ is value-oriented. a. list b. sorted list c. stack d. queue e. binary tree
B
A ______ of height h is full down to level h - 1, with level h filled in from left to right. a. full binary tree b. complete binary tree c. balanced binary tree d. general tree
B
In a tree, the children of the same parent are called ______. a. leafs b. siblings c. roots d. contemporaries
B
In a ______ of height h, all nodes that are at a level less than h have two children each. a. general tree b. binary tree c. full binary tree d. complete binary tree
C
The ______ is a position-oriented ADT that is not linear. a. sorted list b. queue c. binary tree d. list
C
The node that is directly above node n in a tree is called the ______ of node n. a. root b. leaf c. parent d. child
C
2. The ADT stack manages an association between data items and the ______ of the data items. a. names b. values c. sizes d. positions
D
A full binary tree whose height is 4 has ______ nodes. a. 7 b. 8 c. 15 d. 31
D
A node directly below node n in a tree is called a ______ of node n. a. root b. leaf c. parent d. child
D
Each node in a binary tree has ______. a. exactly one child b. at most one child c. exactly two children d. at most two children
D
In ______, the left and right subtrees of any node have heights that differ by at most 1. a. all trees b. all binary tress c. n-ary trees d. balanced binary trees
D
Locating a particular item in a balanced binary search tree of n nodes requires at most ______ comparisons. a. n b. n / 2 c. (n / 2) - 2 d. log2(n + 1)
D
The minimum height of a binary tree of n nodes is ______. a. n b. n / 2 c. (n / 2) - 2 d. log2(n + 1)
D
The post order traversal of the following tree is a. 1, 2, 3, 4, 5, 6, 7, 8, 9 b. 6, 2, 1, 4, 3, 5, 8, 7, 9 c. 6, 2, 8, 1, 4, 7, 9, 3, 5 d. 1, 3, 5, 4, 2, 7, 9, 8, 6
D
Which of the following is NOT a property of a complete binary tree of height h? a. all nodes at level h - 2 and above have two children each b. when a node at level h - 1 has children, all nodes to its left at the same level have two children each c. when a node at level h - 1 has one child, it is a left child d. all leaves are at level h
D