#
17. Suppose the keys 3, 4, 45, 21, 92, 12 are inserted into a BST in this order. What is the preorder traversal of the
elements?
a. 3 4 12 21 45 92
b. 3 4 45 21 12 92
c. 12 21 92 45 4 3
d. 4 45 21 12 92 3
e. 4 21 12 92 45 3
#
19. Suppose the keys 3, 4, 45, 21, 92, 12 are inserted into a BST in this order. What is the preorder traversal of the
elements after inserting 2 into the tree?
a. 3 2 4 12 21 45 92
b. 3 2 4 45 21 12 92
c. 12 2 21 92 45 4 3
d. 4 2 45 21 12 92 3
e. 4 2 21 12 92 45 3
#
5. The is to visit the left subtree of the current node first, then the current node itself, and finally the right
subtree of the current node.
a. inorder traversal
b. preorder traversal
c. postorder traversal
d. breadth-first traversal
#
6. The is to visit the left subtree of the current node first, then the right subtree of the current node, and
finally the current node itself.
a. inorder traversal
b. preorder traversal
c. postorder traversal
d. breadth-first traversal
#
7. The is to visit the current node first, then the left subtree of the current node, and finally the right
subtree of the current node.
a. inorder traversal
b. preorder traversal
c. postorder traversal
d. breadth-first traversal
#
Section 25.7 The BST Class
9. In the implementation of BST, which of the following are true?
a. Node is defined as an inner class inside BST.
b. Node is defined as a static inner class inside BST because it does not reference any instance data fields in BST.
c. Node has a property named left that links to the left subtree and a property named right that links to the right
subtree and a property named right