Work Note 13, DM803, fall 2014
Lecture December 2
Exercises December 3
-
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.
Announcements
-
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: Mon Nov 24 15:30:14 CET 2014
Kim Skak Larsen
(kslarsen@imada.sdu.dk)