Work Note 12, DM803, fall 2016
Exercises December 1
-
Together we will develop known data structures from basic design ideas.
First, a balance idea for binary search trees: For any node, the height
of its subtrees may differ by at most one. Before the exercises, try
to think about the following questions:
-
Which height bound can be guaranteed? A good way to approach this would be
to make the tree with the smallest number of nodes for a given height;
try small heights first. Can see you a pattern?
-
Which problems can insertions and deletions create?
-
Can you find at least a partial collection of rebalancing operations that
remove these problems? What kind of strategy might be good if we aim
for efficiency?
-
The next idea generalizes B-trees that you may know from a database course.
The balance idea is that all leaves have the same distance from the root,
but the number of children of a node vary between a minimum of a
and a maximum of b.
-
What must we require regarding a and b to ensure logarithmic
search times? Which other considerations do you have regarding storing
the content of a node?
-
What are the rebalancing problems and how do we design rebalancing operations
to fix them?
-
Which a and b will this work for? Which will it work
well for?
-
Consider turning skip lists into a deterministic (non-probabilistic)
data structure, i.e., instead of choosing the level of an
element probabilistically hoping that we get the right mix of levels,
we decide that in between to elements of level l, l > 1,
we must have exactly one or two elements of level l-1.
Rethink properties and operations on the structure.
Lecture December 5
Announcement
-
Note that the decision regarding our scheduled meeting time on December 5,
which was cancelled at some point, has been reverted,
so we'll meet there as usual.
Last modified: Wed Nov 30 07:36:17 CET 2016
Kim Skak Larsen
(kslarsen@imada.sdu.dk)