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
A heap sort sorts elements by constructing a heap out of them, and then removing them one at a time from the root.
(True/False)
4.8/5
(40)
In a binary search tree, the elements in the right subtree of the root are __________________ the root element.
(Multiple Choice)
4.9/5
(37)
In a maxheap, the largest element in the structure is always ______________________ .
(Multiple Choice)
4.8/5
(36)
What is special about the order in which the nodes are visited in an inorder traversal of a binary search tree.
(Short Answer)
4.8/5
(32)
Consider the following binary search tree.
What is the result of removing the following elements (in order): 13, 16, 12.

(Short Answer)
4.7/5
(34)
Suppose we have a class called BinaryTree that includes a find method. If we extend the class to create a BinarySearchTree class, should we override the find method or use it as is? Explain.
(Essay)
4.9/5
(41)
Which of the following is always true when adding an element to a heap?
(Multiple Choice)
4.9/5
(42)
Draw a binary search tree that results from inserting the following elements: 12, 16, 9, 1, 15, 13
(Essay)
4.8/5
(44)
Finding an element in a binary search tree always requires O(log2 n) comparisons.
(True/False)
4.7/5
(33)
Describe the steps involved in performing a right rotation on a node in a binary search tree.
(Essay)
4.8/5
(33)
In a binary search tree, a new element is always added as a leaf.
(True/False)
4.8/5
(37)
Whenever a new element is added to a maxheap, it always becomes the root.
(True/False)
4.8/5
(31)
When removing an element from a binary search tree that has a single child, _____________________ will ensure that the resulting tree is still a binary search tree.
(Multiple Choice)
4.8/5
(29)
Showing 21 - 40 of 40
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)