Question 8
Consider the tree below. What is the value stored in the parent node of the node containing 30?
Question 8 options:
10 |
|
11 |
|
14 |
|
40 |
|
None of the above |
Question 9
Consider the tree below. How many descendants does the root have?
Question 9 options:
0 |
|
2 |
|
4 |
|
8 |
Question 10
Consider the tree below. What is the depth of the tree?
Question 10 options:
2 |
|
3 |
|
4 |
|
8 |
|
9 |
Question 11
Consider the tree below. How many children does the root have?
Question 11 options:
2 |
|
4 |
|
6 |
|
8 |
|
9 |
Question 12
What is the minimum number of nodes in a complete binary tree with depth 3?
Question 12 options:
3 |
|
4 |
|
8 |
|
11 |
|
15 |
Question 13
Select the one true statement.
Question 13 options:
Every binary tree is either complete or full. |
|
Every complete binary tree is also a full binary tree. |
|
Every full binary tree is also a complete binary tree. |
|
No binary tree is both complete and full. |
Question 14
Consider the tree below. What is the order of nodes visited using a pre-order traversal?
Question 14 options:
1 2 3 7 10 11 14 30 40 |
|
1 2 3 14 7 10 11 40 30 |
|
1 3 2 7 10 40 30 11 14 |
|
14 2 1 3 11 10 7 30 40 |
Question 15
In the linked list implementation of the queue class, where does the push member function place the new entry on the linked list?
Question 15 options:
At the head |
|
At the tail |
|
After all other entries that are greater than the new entry. |
|
After all other entries that are smaller than the new entry. |
Question 8 Consider the tree below. What is the value stored in the parent node of...
QUESTION 9 Consider the following binary search tree: If the root node, 50, is deleted, which node will become the new root? A 15 B 24 C 37 D 62 QUESTION 10 In the following trees EXCEPT______, the left and right subtrees of any node have heights that differ by at most 1. A complete trees B perfect full trees C balanced binary trees D binary search trees QUESTION 11 A perfect full binary tree whose height is 5 has...
You are given a binary tree of the form: Each node in the tree has a left child and a right child. Each of the children will be extended as a linked list. Every node has the following attributes: key, left node, right node, and next node. The next node allows a node, that is a part of the tree, to be extended as a linked list. The diamonds represent the next nodes, which are part of the linked list...
What is the height of the node that contains 10 in the tree below? A. 8, 13, 4, 2, 5, 14, 9, 1, 10, 15, 6, 3, 11, 7, 12 B. 1, 2, 4, 8, 13, 5, 9, 14, 3, 6, 10, 15, 7, 11, 12 C. 13, 8, 4, 14, 9, 5, 2, 15, 10, 6, 11, 12, 7, 3, 1 D. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
Trees and Heaps 1. Show that the maximum number of nodes in a binary tree of height h is 2h+1 − 1. 2. A full node is a node with two children. Prove that the number of full nodes plus one is equal to the number of leaves in a nonempty binary tree. 3. What is the minimum number of nodes in an AVL tree of height 15? 4. Show the result of inserting 14, 12, 18, 20, 27, 16,...
Problem 2 (8 pts): Structural Induction In a binary tree, a full node is a node with two children. Using structural induction, prove that the number of full nodes plus one is equal to the number of leaves in a binary tree (even if the tree itself is not necessarily full, i.e. some nodes may not be full)
14 2 11 AI 13 10 30 // 740 What is the value stored in the parent node of the node containing 14? 10 14 none of the above 40 11 14 / 2 11 1 3 10 30 7 40 What is the order of nodes visited using a post-order traversal? 13 2 7 10 40 30 11 14 12 3 7 10 11 14 30 40 1 2 3 14 7 10 11 40 30 142 13 11...
Insert the following values in the given order into a Binary Search Tree and use the resulting BST in the next 5 questions. 15 8 3 6 23 9 11 10 20 13 5 9. What is the height of the resulting Binary Search Tree? 10. What is the depth of the node that stores the value 11? 11. Is there a path from the node storing the value 15 to the node storing the value 5? If so, show...
A binary tree node is called full if the node contains 2 children. Use a proof by induction to prove that in any binary tree, the number of leaves in the tree is equal to the number of full nodes plus one. (Hint: your inductive step should consider two cases: the k+1 node becomes the only child of a node that was previously a leaf; and the k+1 node becomes the second child of a node that previously only had...
QUESTION 1 In a tree, a ____ is a node with successor nodes. root child descendent parent sibling QUESTION 2 In a tree, the ____ is a measure of the distance from a node to the root. count degree branch height level QUESTION 3 Which of the following is not a characteristic of a binary search tree? Each node has zero, one, or two successors. The preorder traversal processes the node first, then the left subtree, and then the right...
Which of the following is true for a Binary Tree? Question 7 options: A binary tree is a tree, since no node has more than 2 children, they are known as the left child and the right child The root node is the node without a parent A leaf node is a node without child nodes All of the above