Exam 15: Heaps and Priority Queues
Exam 1: Introduction40 Questions
Exam 2: Data and Expressions40 Questions
Exam 3: Using Classes and Objects40 Questions
Exam 4: Conditionals and Loops40 Questions
Exam 5: Writing Classes40 Questions
Exam 6: Graphical User Interfaces40 Questions
Exam 7: Arrays40 Questions
Exam 8: Inheritance40 Questions
Exam 9: Polymorphism39 Questions
Exam 11: Recursion40 Questions
Exam 10: Exceptions40 Questions
Exam 12: Searching and Sorting40 Questions
Exam 13: Trees40 Questions
Exam 14: Introduction to Collections and Stacks40 Questions
Exam 15: Heaps and Priority Queues40 Questions
Exam 16: Graphs40 Questions
Select questions type
In a balanced binary search tree, adding an element always requires approximately O(log2 n) steps.
Free
(True/False)
4.9/5
(37)
Correct Answer:
True
Finding an element in a balanced binary search tree that contains n elements requires _____________________ comparisons.
Free
(Multiple Choice)
4.8/5
(30)
Correct Answer:
D
Left and right rotations can be used to rebalance an unbalanced binary search tree.
Free
(True/False)
4.9/5
(34)
Correct Answer:
True
In a binary search tree, the elements in the right subtree of the root are always larger than the element stored at the root.
(True/False)
4.8/5
(32)
In a binary search tree, the elements in the left subtree of the root are __________________ the root element.
(Multiple Choice)
4.9/5
(40)
A ____________________ is a complete binary tree in which each element is greater than or equal to both of its children.
(Multiple Choice)
4.8/5
(36)
Describe how to find an element in a binary search tree. You may use English sentences or pseudocode.
(Essay)
4.9/5
(37)
In the worst case, a general binary search tree could require __________________ comparisons to find an element.
(Multiple Choice)
4.8/5
(47)
When removing an element from a binary search tree that is a leaf, ______________ will ensure that the resulting tree is still a binary search tree.
(Multiple Choice)
4.9/5
(42)
A _____________________ is a tree whose elements are organized to facilitate finding a particular element when needed.
(Multiple Choice)
4.8/5
(36)
When adding a new element to a binary search tree, the element is added as a(n) ______________.
(Multiple Choice)
4.8/5
(42)
When removing an element from a binary search tree that has two children, _______________________ will ensure that the resulting tree is still a binary search tree.
(Multiple Choice)
4.8/5
(33)
Does the find and add operations on a binary search tree always require at most O(log2 n) comparisons? If so, why? If not, why not?
(Essay)
5.0/5
(31)
Explain the process of removing an element from a binary search tree.
(Essay)
4.9/5
(34)
If a binary search tree becomes unbalanced after an element is added, it is sometimes possible to efficiently rebalance the tree by ___________________ .
(Multiple Choice)
4.7/5
(41)
When removing an element from a binary search tree, we must always ______________________.
(Multiple Choice)
4.8/5
(26)
A binary search tree that is highly unbalanced is called a ________________ tree.
(Multiple Choice)
5.0/5
(36)
Showing 1 - 20 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)