This preview shows pages 1–2. Sign up to view the full content.
CS251 Homework 2
Due date: Wednesday April 27, 11:59pm in Blackboard, submit PDF ﬁles only.
This is a ﬁrm deadline
: no extensions or late submissions will be
accepted, since solutions will be released immediately after the deadline.
True/False Questions (20 pts)
1. If you insert keys in increasing order into a redblack BST, the tree height is mono
tonically increasing.
True.
2. A good hash function should be deterministic, i.e., equal keys produce the same hash
value.
True.
3. In the situation where all keys hash to the same index, using hashing with linear
probing will result in
O
(
n
) search time for a random key.
True.
4. Hashing is preferable to BSTs if you need support for ordered symbol table operations.
False.
5. In an adjacency list representation of an undirected graph,
v
is in
w
’s list if and only
if
w
is in
v
’s list.
True.
6. Every directed, acyclic graph has a unique topological ordering.
False.
7. Preorder traversal is used to topologically sort a directed acyclic graph.
False.
8. MSD string sort is a good choice of sorting algorithm for random strings, since it
examines
Nlog
R
N
characters on average (where
R
is the size of the alphabet).
True.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '08
 Staff
 Data Structures

Click to edit the document details