Work Note 12, DM803, fall 2014
Lecture November 25
Exercises November 26
-
This is an open exercise problem; not necessarily in the sense that it
is unknown in general, but I do not have the answer:
How unbalanced can you make a splay tree?
You could answer this for small n; possible by writing a program
and performing some sort of exhaustive search.
Can one arrange imbalance for families of access sequences for
growing n?
Note that this is starting with an empty tree and applying insertions
and accesses, and that a newly inserted node is also splayed to the top.
-
Show that the splay operations can be formulated as at most two
single rotations.
-
Compute the potential of a perfectly balanced tree as well as the
potential of a tree which has deteriorated to a linked list.
-
At the lecture, we did the amortized analysis of only one of the
splay operations; the one where x was the left child of a
left child. Complete the analysis of the other operations as well.
-
We argued briefly in class that a single rotation preserves the
search tree invariant.
Argue more broadly that this is also the case for the following:
Consider any connected subgraph of nodes in a search tree
(for the single rotation, the subgraph has two nodes).
Now, remove all trees hanging off nodes in this subgraph in an
in-order fashion and, separately, all the keys of nodes of the subgraph
in an in-order fashion.
Then rearrange the subgraph into any other connected subgraph.
Add the keys to the nodes in-order and attach the trees again,
also inorder.
Argue that the tree is a search tree.
-
For Y-Fast Tries, we had to keep the sizes of the small red-black trees
in the range [(log M) / 4, 2 log M].
Thus, for deletion, when a tree got too small, we would merge it with
a neighbor. If this merge was then above or too close to the high
end of the allowed interval, we would split into two even-sized
trees (±1).
Choose when to split with the aim of maximizing the worst-case
distance to one of the extreme points of the allowed interval
for any of the up to two trees involved that will be created.
(In the lecture, we arbitrarily chose to split if the size exceeded
(3/2) log M.)
Announcements
-
Due to the cancellations last week, this weekly note is identical
to the previous one; with the obvious exceptions... ツ
-
Please see the
job announcement
if you are interested in becoming a teaching assistant
("instruktor") in the Spring.
The application deadline is November 28, 2014.
Last modified: Fri Nov 21 15:45:06 CET 2014
Kim Skak Larsen
(kslarsen@imada.sdu.dk)