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 balanced trees is NOT correct?
(Multiple Choice)
4.8/5
(31)
Consider the following Huffman encoding tree:
The letter H will be encoded as ____.

(Multiple Choice)
4.9/5
(38)
Given the BinaryTree class (partially shown below), select an expression to complete the static recursive helper method countLeaves, which returns the number of leaf nodes in the binary tree rooted at node n.

(Multiple Choice)
4.8/5
(37)
Consider the following tree diagram:
Which of the following nodes are parent nodes?

(Multiple Choice)
4.8/5
(43)
Consider the following tree diagram:
Which of the following is a path in the tree?

(Multiple Choice)
4.8/5
(34)
Consider the following tree diagrams:
Which of the above are binary search trees?

(Multiple Choice)
4.8/5
(37)
Consider the following tree diagram:
What is the height of the subtree with root R?

(Multiple Choice)
4.9/5
(42)
Given the Node class (partially shown below), select a statement to complete the recursive method descendants, which is designed to return the number of descendants of a node.

(Multiple Choice)
4.8/5
(25)
Consider the following tree diagram:
Which of the following is NOT a path starting with the node P in the tree?

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

(Multiple Choice)
4.7/5
(38)
If a min-heap has 14 nodes, what is known for certain when we add a new node?
i.every level of the tree will be fully occupied
II.the tree does not grow a new level
III.the root contains the smallest element
(Multiple Choice)
4.9/5
(40)
Given the BinaryTree class (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.

(Multiple Choice)
4.9/5
(32)
You wish to traverse a binary search tree in sorted order.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
(32)
Consider the following addNode method for inserting a newNode into a binary search tree:
Which of the following sequences of insertions will result in a balanced tree? In each sequence, the first node inserted becomes the root of the tree on which the addNode method is called for the subsequent insertions.
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.9/5
(27)
Locating an element in a balanced binary search tree takes ____ time.
(Multiple Choice)
4.9/5
(30)
Consider the following tree diagram:
What is the height of this tree?

(Multiple Choice)
4.9/5
(38)
Which of the following statements about removing a node from a red-black tree is correct?
(Multiple Choice)
4.9/5
(42)
The height h of a completely filled binary tree with n nodes is ____.
(Multiple Choice)
4.9/5
(33)
Showing 41 - 60 of 102
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)