Exam 17: Tree Structures
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
In a binary search tree, where the root node data value = 45, what do we know about the values of all the descendants in the right subtree of the root?
(Multiple Choice)
4.8/5
(39)
Consider the following binary search tree diagram:
If node M is to be removed, which action should be taken?

(Multiple Choice)
4.7/5
(37)
A min-heap is a binary tree structure in which missing nodes may only occur where?
(Multiple Choice)
4.9/5
(32)
You are using a tree to show the evaluation order of arithmetic expressions. Which of the following statements is NOT correct?
(Multiple Choice)
4.8/5
(30)
You wish to traverse a binary search tree in sorted order using inorder traversal. Arrange the following actions in the correct order to accomplish this.
I Print the right subtree recursively
II Print the root
III Print the left subtree recursively
(Multiple Choice)
4.9/5
(41)
Which of the following statements about the three tree traversal schemes studied, is correct?
(Multiple Choice)
4.8/5
(35)
Which of the following sequences of insertions will result in a balanced tree?
I 12 , 7, 25, 6, 9, 13, 44
II 12 , 7, 25, 44, 13, 6, 9
III 12, 25, 44, 13, 6, 9, 7
(Multiple Choice)
4.8/5
(39)
What does the left node reference of a newly inserted binary search tree node get set to?
(Multiple Choice)
4.8/5
(39)
Consider the following tree diagram:
Which of the following nodes are interior nodes?

(Multiple Choice)
4.8/5
(39)
Adding an element to a balanced binary search tree takes ____ time.
(Multiple Choice)
4.7/5
(39)
Consider the following binary search tree:
Which of the following sequences correctly represents breadth-first traversal of this tree?

(Multiple Choice)
4.9/5
(32)
The height h of a completely filled binary tree with n nodes is ____.
(Multiple Choice)
4.9/5
(36)
Consider the following tree diagram:
What is the size of the subtree with root P?

(Multiple Choice)
4.8/5
(42)
As implemented in the textbook, a tree class contains which of the following?
I Node class
II Root node
III List of child nodes
(Multiple Choice)
4.7/5
(46)
When we map a min-heap with n elements to an array with n + 1 elements, the right child of the root is stored at which array index?
(Multiple Choice)
4.8/5
(45)
Consider the following binary search tree diagram:
Which of the following trees represents the correct result after inserting element B? 


(Multiple Choice)
4.9/5
(34)
Consider the following tree diagrams:
Which of these trees is considered to be unbalanced?

(Multiple Choice)
4.9/5
(44)
Given the BinaryTree class discussed in section 17.2 (partially shown below), select an expression to complete the static recursive helper method rightMostValue, which is designed to return the data value in the rightmost node of the tree rooted at node n. public class BinaryTree
{
Private Node root;
Public BinaryTree()
{
Root = null;
}
Public BinaryTree(Object rootData, BinaryTree left, BinaryTree right)
{
Root = new Node();
Root.data = rootData;
Root.left = left.root;
Root.right = right.root;
}
Class Node
{
Public Object data;
Public Node left;
Public Node right;
}
Public Object rightMostValue()
{
If (root == null)
{
Return null;
}
Else
{
Return rightMostValue(root);
}
}
Public static Object rightMostValue(Node n)
{
If (n.right == null)
{
Return n.data;
}
Else
{
Return ______________________;
}
}
}
(Multiple Choice)
4.7/5
(47)
Showing 41 - 60 of 110
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)