EECS 233 Written Assignment #3
AKSHAYA ANNAVAJHALA
1.
Chapter 6, Exercise 6.2
(3points)
1
3
2
6
7
5
4
15
14
12
9
10
11
13
8
2.
Consider two efficient algorithms for the selection problem we discussed as an
application of heaps (see lecture 13 slides 11 and 12; similar algorithms are
discussed as Algorithm 6a and 6b in sec. 6.4.1 of the book). We discussed that
both algorithms exhibit similar running time when k is small (constant) and large
(Θ(N)). Which of the algorithms has a better running time bound for intermediate
values of k, that is when k is not constant (e.g., it does grow with N) but its
growth is sublinear?
(3 points)
Algorithm 1 is O(N + k log N), and Algorithm 2 is O(k + (Nk)log k). thus, if k is
sublinear, Algorithm 1 will grow slower, as 1 will be O(N) and 2 will be a linear
multiplied by the log of a sublinear term.
3.
Chapter 5, Exercise 5.1
(3 points)
0
1
2
3
4
5
6
7
8
9
4371
6173
4344
1989
1323
9679
4199
Each entry is introduced at the head of the doubly linked list for each cell
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
 Rabinovich
 Algorithms, hash function, hash value, 1%, hash values

Click to edit the document details