Heaps, Graphs, & Hashing
A maxheap sort will provide a sorted list in ascending order. (True/False)
False Because a max heap has the largest element as the root, the sorted order is descending.
A maxheap is a complete binary tree in which each element is __________.
Greater than or equal to both of its children
The __________ method for handling collisions looks for another open position in the table other than the one to which the element is originally hashed.
Open addressing
A cycle is a path that starts and ends on the same vertex without repeating any edges. (True/False)
True
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)
True
When using chaining for each index, the number of items that can be stored in a hash table is limited by the size of the hash table. (True/False)
True
In a(n) __________ graph, an edge from a node labeled A to a node labeled B is the same as having an edge from B to A.
Undirected
In graph terminology, the nodes are referred to as __________.
Vertices
For a given set of elements __________. a. There is exactly one heap configuration b. There can be many heap configurations c. An infinite number of configurations is possible d. You can only form a heap if all the elements are unique e. None of the above
b. There can be many heap configurations
Which of the following is always true for a priority queue? a. Elements are stored using a FIFO queue. b. Elements are stored using a LIFO stack. c. Elements must be added in priority order. d. An element with the highest priority is retrieved first. e. None of the above is always true.
d. An element with the highest priority is retrieved first.
In the __________ method, the index is formed by extracting, and then manipulating, specific digits from the key. a. Shift folding b. Mid-square c. Radix transformation d. Digit analysis e. None of the above
d. Digit analysis
Which of the following is always true when adding an element to a heap? a. The new element will always be a leaf. b. The new element will always be the root. c. The new element will always be an internal node. d. The new element will always have two children. e. None of the above is always true.
e. None of the above is always true.