Question
Java Programming Question 10 One typical approach for periodic rebalancing is to create a new, empty tree, then create a sorted array by doing an
Java Programming
Question 10
One typical approach for periodic rebalancing is to create a new, empty tree, then create a sorted array by doing an inorder traversal, then splitting the array in half, taking the middle element and adding it to the new tree, then recursing to process the rest of the array.
Group of answer choices
True
False
Question 9
In a UML Class Diagram, aggregation means the child cannot exist independently of the parent
Group of answer choices
True
False
Question 8
Two common balancing approaches are periodic rebalancing and continuous rebalancing.
Group of answer choices
True
False
Question 7
The more a tree is out of height balance, the more the search algorithm moves from...
Group of answer choices
O(n) to O(n^2)
O(n) to O(log n)
O(log n) to O(n)
O(log n) to O(n log n)
Question 6
Which of these statements are true about a standard TreeMap?
Group of answer choices
they have two generics (type parameters)
as with all maps, they map Keys to Values
their generics are often called K (for "key") and V (for "value")
since they are implemented with a BST, they automatically maintain ordering
they can be used to implement an Index concept, where Values are always integers
Question 5
When working with BSTs, inorder traversals are popular as they yield sorted order, lowest to highest value.
Group of answer choices
True
False
Question 4
Describe the typical traversal orders for binary trees, using one of these words: preorder, inorder, postorder
------Process the left subtree, then the root, then the right subtree
----- Process the left subtree, then the right subtree, then the root
----- Process the root, then the left subtree, then the right subtree
Question 3
Which statements are true about binary search trees?
Group of answer choices
they are binary trees whose nodes have at most two children
the left subtree's elements have values that are greater than the value of the parent node.
they maintain a root reference
they are considered "height balanced" if the count of nodes on the left is within one of the count of nodes on the right
Question 2
An internal node is a node that has at least one child.
Group of answer choices
True
False
Question 1
To determine a tree's height, count the nodes from the root to the farthest leaf node.
Group of answer choices
True
False
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started