Due After The Quarantine. Stay Safe Everyone.: CMPSC 133: Design & Analysis of Algorithms
Due After The Quarantine. Stay Safe Everyone.: CMPSC 133: Design & Analysis of Algorithms
I. MULTIPLE CHOICE. Write the letter of the BEST answer before the item number. (2 points each)
1. The minimum number of children of the root node of a B*tree of order m=9.
a. 2 b. 3 c. 4 d. 5
2. The minimum number of key values of an interior node of a B tree of order m=7.
a. 2 b. 3 c. 4 d. 5
3. The maximum number of children in an interior node of a B* tree of order m=5.
a. 3 b. 4 c. 5 d. 6
4. In a B+ tree, S0 is a pointer to a node containing key values ____ the first key value in the parent node.
a. > b. < c. ≤ d. ≥
5. In a B tree, Sn is a pointer to a node containing key values ____ the last key value in the parent node.
a. > b. < c. ≤ d. ≥
6. A kind of tree which is useful in storing words in a dictionary.
a. B tree b. B* tree c. B+ tree d. Trie
7. Insertion in a full root node of a B* tree, where all the children are also full results to a/an
a. increase in tree height b. merge c. rotation d. redistribution
8. Deletion in an interior node of a B tree where the children contain the minimum number of key
values results to a
a. split b. merge c. rotation d. redistribution
9. Deletion in the root node of a B * tree with only one key value and the children are all at a minimum
results to a
a. split b. merge c. rotation d. decrease in tree height
10. Insertion to a full node in a B tree results to a
a. split b. merge c. rotation d. redistribution
11. The minimum number of key values in the interior node of a B* tree of order m is
a. m/2 b. (m/2) -1 c. (2m-1)/3 d. (2m-1)/3 - 1
12. The color of the root node of a red-black tree is
a. always red b. always black c. maybe red or black d. does not matter
13. The children of a red node in a red-black tree is
a. always red b. always black c. maybe red or black d. does not matter
14. A node in a B tree with 3 key values can have 0 or
m. 2 pointers a. 3 pointers t. 4 pointers h. 1,2,3, or 4 pointers
15. In an AVL tree, the height difference between the left and the right subtree is
w. at most 1 r. at least 1 u. exactly 1 k. exactly 0
II. Describe briefly each of the following operations: (note that the involved node may either contain the
minimum number of key values, more than the minimum, or full)
1. Insertion in the root node of a B tree ; (10 points)
a) root node is full
The next key value to be inserted at the root node that is full will cause the root node to split into 2
nodes
If no siblings have more than minimum number of keys, Merge with siblings and the
minimum of parent nodes
The target key will be replaced with the minimum of a parent node
III. Insert the following key values into an AVL tree. Rotate as necessary and identify the kind of rotation
applied in each case: (10 points)
10, 20, 30, 40, 50, 05, 01, 65, 55.