Work Note 15, DM206, fall 2010
Exercises December 16
-
Consider the data structures covered in
the course. Which can be made partially
persistent using the node-copying method from [DSST89]?
-
Try the method from [DSST89] on a singly-linked list.
The list must be kept sorted and there is one access
pointer (to the first element in the list).
Insert the elements (in that order):
1, 5, 9, 2, 3, 4, 8, 7, 6.
Then delete: 5, 4, 3, 2, 1, 7, 8, 9, 6.
Change version after each update
(19 versions in total).
Assume that there is one extra pointer.
[We will not necessarily cover all of this in class.]
-
Assume we have a singly-linked list of length n.
We now repeat indefinitely: change to new
version and make a change in the last element of the list.
How often is the first element of the list copied
using the method from [DSST89]?
Assume that there is one extra pointer.
-
Show that if there are fewer extra pointer fields
than the number of inverse pointers,
then the method from [DSST89] may use time which is
not amortized constant per update.
-
For van Emde Boas Trees we needed that
T(n)=T(√n)+1
had solution T(n)∈O(loglog n)
and were motivated by the fact that
T(n)=2T(√n)+1
had solution
T(n)∈Ω(log n)
.
Prove these two facts.
-
At the lecture, when discussing dynamization, we proposed deleting
elements from a structure by justing marking them as being deleted.
Assume that every time we have completely rebuild the structure
with n elements, we wait n/2 operations and then rebuild again.
Given that construction time is O(n log n), define a potential
function to show that deletion is amortized O(log n),
while insertion remains amortized O(log2 n)
and searching remains O(log2 n).
-
Problem sheet 1 for work note 15.
-
Problem sheet 2 for work note 15.
Last modified: Tue Dec 14 11:19:25 CET 2010
Kim Skak Larsen
(kslarsen@imada.sdu.dk)