Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Software Structures
Quiz 11: Binary Search Trees
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Question 21
Short Answer
Though not a queue at all, a ______ provides an efficient implementation of a priority queue.
Question 22
Short Answer
Because of the requirement that we be able to traverse up the tree after an insertion, it is necessary for the nodes in a heap to store a pointer to their ______.
Question 23
Short Answer
In an array implementation of a binary tree, the root of the tree is in position 0, and for each node n, n's left child is in position ______ and n's right child is in position ______.
Question 24
Short Answer
The addElement operation for both the linked and array implementations is O(______).
Question 25
Short Answer
The removeMin operation for both the linked and array implementations is O(______)
Question 26
Short Answer
The heapSort method consists of adding each of the elements of the list to a ______ and then removing them one at a time. If the heap is a minheap, this results in ______ order. However, if the heap is a maxheap, this results in ______ order.
Question 27
Short Answer
Heap sort is O(______).
Question 28
True/False
A minheap is a complete binary tree in which each node is less than or equal to both the left child and the right child.
Question 29
True/False
A minheap stores its largest element at the root of the binary tree, and both children of the root of a minheap are also minheaps.
Question 30
True/False
The addElement method adds a given Comparable element to the appropriate location in the heap, maintaining both the completeness property and the ordering property of the heap.
Question 31
True/False
Since a heap is a binary search tree, there is only one correct location for the insertion of a new node, and that is either the next open position from the left at level h or the first position on the left at level h+1 if level h is full.