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
Removing an element from an unbalanced binary search tree takes ____ time.
(Multiple Choice)
4.9/5
(44)
What is the efficiency of adding an element to a red-black tree?
(Multiple Choice)
5.0/5
(28)
Consider the following tree diagrams:
Which tree represents the arithmetic expression 2 *5 + 4?

(Multiple Choice)
4.7/5
(42)
Which of the following statements about the three tree traversal schemes studied is correct?
(Multiple Choice)
4.8/5
(47)
Consider the following tree diagram:
What is the size of the subtree with root R?

(Multiple Choice)
4.8/5
(40)
Consider the following tree diagram:
What is the height of this tree?

(Multiple Choice)
4.8/5
(40)
What is the efficiency of locating an element in a red-black tree?
(Multiple Choice)
4.7/5
(36)
Given the Node class discussed in section 17.1 (partially shown below), select a statement to complete the recursive method descendants, which is designed to return the number of descendants of a node. class Node
{
Public Object data;
Public List<Node> children;
) . .
Public int descendants()
{
Int num = 0;
For (Node child : children)
{
_____________________________
}
Return num;
}
}
(Multiple Choice)
4.9/5
(42)
Consider the following tree diagram:
What is the height of the subtree with root R?

(Multiple Choice)
4.8/5
(36)
You wish to traverse a binary search tree in sorted order using preorder 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.8/5
(41)
Consider the following tree diagram:
Which of the following nodes are leaf nodes?

(Multiple Choice)
4.8/5
(35)
Insert the missing code in the following code fragment. This fragment is intended to create an iterator to be used to process elements of a tree. TreeSet<String> aTree = . . .
String first = iter.next();
String second = iter.next();
(Multiple Choice)
4.8/5
(48)
If the postorder traversal visits the nodes of a binary tree storing character values in the order of U, G, T, R, A, I, what is the value of the root of the tree?
(Multiple Choice)
4.8/5
(32)
Consider the following tree diagram:
Which of the following nodes are root nodes?

(Multiple Choice)
4.8/5
(41)
Which of the following statements about inserting a node into a red-black tree is NOT correct?
(Multiple Choice)
4.8/5
(27)
Which of the following statements about a binary search tree is correct?
(Multiple Choice)
4.8/5
(35)
Consider the following tree diagram:
What is the size of this tree?

(Multiple Choice)
4.9/5
(38)
Which of the following statements about inserting a node into a red-black tree is correct?
(Multiple Choice)
4.9/5
(36)
Consider the following tree diagram:
What is the height of the subtree with root P?

(Multiple Choice)
4.8/5
(41)
In a binary search tree, where the root node data value = 45, what do we know about the data values of all the descendants in the left subtree of the root?
(Multiple Choice)
4.8/5
(43)
Showing 21 - 40 of 110
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)