This quiz is homework assignment #4. Any question you answered correctly in class are considered correct for the purposes of the assignment. Any question you did not answer or which you answered incorrectly is now a short answer question for the homework assignment due in class on Wednesday. We will hand back the graded quiz on Friday.
In italics are instructions on how to answer each question for homework. The correct letter answer is listed after each question.
Good luck!
Describe the (most precise) asymptotic relationship relationship between each pair. Explain why (a) is the answer and why each of (b)-(e) breaks one of the conditions.
In which of the following is
Correct answer(s): (a)
The following is a flawed best case analysis of merging skew heaps in terms of n, the total size of the heaps. Which option below describes the flaw?
If n=4 and both heaps are leftist heaps with half of the elements, neither one's root will have a right child. Therefore, the merge will take time.
Correct answer(s): (a)
We can build each of the following structures from a set of initial data by repeatedly calling insert until the data structure is complete, taking O(n) times the time for an insert.
However, we can do better with several of these data structures. Which of the following cannot be built asymptotically faster than the naive method described here?
Hint: remember that any binary heap is a leftist heap!
Correct answer(s): (b)
Which of these does not ensure a balanced or nearly balanced tree?
Correct answer(s): (c)
Can we ensure that a tree is a Binary Search Tree just by checking that every node's left child has a key less than the node's key and every node's right child has a key greater than the node's key? (Choose the most general answer.)
Correct answer(s): (b)
Which of these heaps enforces the property that a node's children's keys must have larger priority values than the node's key?
Correct answer(s): (e)
Which of the following data structures supports a worst-case merge in time?
Correct answer(s): (e)
Assuming we have a comparator for keys, hash tables support the find minimum operation in:
Correct answer(s): (d)
An insert into an open hashing table (without resizing) is always better than an insert into a closed hashing table (without resizing) under which of the following conditions:
Correct answer(s): (c)