Background: 18.1, 18.2, 12.
Due October 23rd:
- 6.1: Last time, you created a binary search tree from the letters
of the word ``algorithm.'' Do it again, and annotate the tree with
the number of credits the splay analysis would assign to each node.
Now splay on ``m.'' What is the depth of the resulting tree? Where
are the credits now?
- 6.2: Use the amortized analysis template to argue that we can
satisfy a sequence of n operations to a heap (initially empty) in
amortized time for inserts and O(1) amortized time for
delete-max. - 6.3: Give worst-case bounds for executing min, max, min, max, min,
max, ... k times on a balanced binary search tree and a splay tree.
Which is asymptotically more efficient if
? - 6.4: CLR Exercise 12.2-2 (pg 226).
- 6.5: CLR Exercise 12.2-6 (pg 226).
- 6.6: CLR Exercise 12.3-1 (pg 231).
- 6.7: When a hash table fills up, it is often necessary to expand
it (especially with open addressing). Let's say that we start off
with a table of size m=101 and every time we reach
,
we set
and then reinsert all the items into the
new table. Argue that the amortized time to insert a single
item into the hash table over a sequence of n insertions is
. Use the uniform-hashing assumption if you need it.
Up: HOMEWORK
Previous: HOMEWORK