This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Review #10a  Binary Trees and Binary Search Trees (BST) Q UESTION 1 xx The root of a binary tree will always be: A. a parent B. a right child C. a left or right child D. the first node created E. None of these Q UESTION 2 xx The root of a binary tree will always be at level: A. 1 B. C. 1 D. 2 E. None of these Q UESTION 3 xx Which nodes are ancestors of node E ? A. A only B. B only C. D only D. A and B only E. J only Q UESTION 4 xx In a BST, the left child has a value ____ the parent and the right child has a value ____ the parent A. less than equal to B. greater than less than or equal to C. less than or equal to greater than D. greater than less than E. None of these Q UESTION 5 xx What is the worse case scenario when searching for an item in a binary tree? A. the item is not in the tree B. the tree is balanced and the item is in a leaf C. every node has only one child and the item is in the leaf D. the tree is balanced and the item is not in a leaf E. None of these Q UESTION 6 xx What is the best case scenario when searching for an item in a binary tree? A. the item is not in the tree B. the tree is balanced and the item is in a leaf C. every node has only one child and the item is in the leaf D. the tree is balanced and the item is not in a leaf E. None of these Q UESTION 7 xx Which is an inorder traversal of this tree? A. Z Y W T S R P H G F B B. P F B H G S R Y T W Z C. B F G H P R S T W Y Z D. B H G F S R Y T W Z P E. None of these Q UESTION 8 xx Which is an preorder traversal of this tree? A. Z Y W T S R P H G F B B. P F B H G S R Y T W Z C. B F G H P R S T W Y Z D. B H G F S R Y T W Z P E. None of these Q UESTION 9 xx Which is an postorder traversal of this tree? A. Z Y W T S R P H G F B B. P F B H G S R Y T W Z C. B F G H P R S T W Y Z D. B H G F S R Y T W Z P E. None of these © Charlotte Scroggs http://www.cistests.com Java Review 10b  Stacks, Queues, and PriorityQueues  Page 1 A B C D H E I F J G K L M P F S B H R G Y T Z W Q UESTION 10 xx Which is an inorder traversal of the BST to the right? A. * + 5 3 7 / * 4 B. (5 + 3) * (7 (8 / 4)) C. 5 3 + 7 8 4 / * D. ((4 / 8) 7) * (3 + 5) E. None of these Q UESTION 11 xx Which is a preorder traversal of the BST to the right? A. * + 5 3 7 / * 4 B. (5 + 3) * (7 (8 / 4)) C. * + 5 3 7 / 8 4 D. ((4 / 8) 7) * (3 + 5) E. None of these Q UESTION 12 xx Which is a postorder traversal of the BST to the right? A. * + 5 3 7 / * 4 B. (5 + 3) * (7 (8 / 4)) C. 5 3 + 7 8 4 / * D. ((4 / 8) 7) * (3 + 5) E. None of these Q UESTION 13 xx Which statement best describes a full binary tree? A. All of the leaves are on the same level B. The tree is full or full through the nexttolast level C. Every parent has two children D. The value in every node is greater than the value of its children E. None of these Q UESTION 14 xx Which statement best describes a complete binary tree?...
View
Full
Document
 Fall '08
 Staff
 Tree traversal, Nested set model, Charlotte Scroggs http://www.cistests.com

Click to edit the document details