Exam 17: Tree Structures
Exam 1: Introduction76 Questions
Exam 2: Using Objects82 Questions
Exam 3: Implementing Classes108 Questions
Exam 4: Fundamental Data Types124 Questions
Exam 5: Decisions119 Questions
Exam 6: Loops107 Questions
Exam 7: Arrays and Array Lists117 Questions
Exam 8: Designing Classes88 Questions
Exam 9: Inheritance99 Questions
Exam 10: Interfaces100 Questions
Exam 11: Input/Output and Exception Handling108 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion99 Questions
Exam 14: Sorting and Searching100 Questions
Exam 15: The Java Collections Framework102 Questions
Exam 16: Basic Data Structures102 Questions
Exam 17: Tree Structures102 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Stream Processing85 Questions
Exam 20: Graphical User Interfaces75 Questions
Exam 21: Advanced Input/Output90 Questions
Exam 22: Multithreading81 Questions
Exam 23: Internet Networking74 Questions
Exam 24: Relational Databases75 Questions
Exam 25: XML74 Questions
Select questions type
Which of the following statements about inserting a node into a red-black tree is correct?
(Multiple Choice)
4.8/5
(33)
Consider the following tree diagrams:
Which tree represents the arithmetic expression (2 + 5) * 4?

(Multiple Choice)
4.8/5
(30)
Consider the following tree diagram:
Which arithmetic expression is represented by this tree?

(Multiple Choice)
4.9/5
(34)
Which of the following is NOT a property of a red-black tree?
(Multiple Choice)
4.7/5
(54)
Given the BinarySearchTree and Node classes (partially shown below), select an expression to complete the recursive method smallest in the Node class.The method returns the smallest data value in the binary search tree rooted at a node.

(Multiple Choice)
4.7/5
(35)
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
(37)
Assuming that the variable t is instantiated to an empty BinarySearchTree, select a statement to complete the following code segment, so that the resulting binary search tree has a height of 4.

(Multiple Choice)
5.0/5
(43)
Consider the following binary search tree:
Which of the following sequences correctly represents a depth-first traversal of this tree?

(Multiple Choice)
4.8/5
(37)
Which of the following statements about the three tree traversal schemes studied is correct?
(Multiple Choice)
4.8/5
(46)
What is the efficiency of adding an element to a red-black tree?
(Multiple Choice)
4.8/5
(46)
Which of the following statements about the heapsort algorithm is correct?
(Multiple Choice)
4.8/5
(44)
If the child references of a binary tree node are both null, the node is ____.
(Multiple Choice)
4.8/5
(35)
You wish to traverse a binary search tree 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.9/5
(42)
Consider the following binary search tree:
Which of the following sequences correctly represents an inorder traversal of this tree?

(Multiple Choice)
5.0/5
(31)
Consider the following tree diagram:
Which of the following nodes are leaf nodes?

(Multiple Choice)
4.9/5
(37)
Consider the following binary search tree:
Which of the following sequences correctly represents a preorder traversal of this tree?

(Multiple Choice)
4.8/5
(37)
When we map a min-heap with n elements to an array with n + 1 elements, we ignore array element 0, and place the root value at which array index?
(Multiple Choice)
4.8/5
(37)
Which of the following statements about binary trees is correct?
(Multiple Choice)
4.8/5
(41)
Consider the following binary search tree diagram:
Consider the following addNode method for inserting a newNode into a binary search tree:
public void addNode(Node newNode)
{
int comp = newnode.data.compareTo(data);
if (comp < 0)
{
if (left == null) {left = newNode;}
else { left.addNode(newNode); }
}
else
{
if (right == null) {right = newNode;}
else { right.addNode(newNode); }
}
}
Which of the following trees represents the correct result after inserting element B, calling addNode on the root of the tree?


(Multiple Choice)
4.8/5
(42)
Consider the following binary search tree:
Which of the following sequences correctly represents a postorder traversal of this tree?

(Multiple Choice)
4.9/5
(35)
Showing 21 - 40 of 102
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)