Assignment 8 -- Due Friday, November 4
CS 4521 Fall Semester, 2005
20 Points
Topics: Red-black trees, B-trees
The assignment
consists of two parts. In the first part, you will implement
red-black tree deletion.
The second part consists of red-black tree and B-tree exercises.
Part 1: Coding Red-Black Tree Deletion (10 points)
After adding red-black deletion to your program of the previous assignment,
run it on the remaining red-black tree test files:
treetest3,
treetest4, and
treetest5.
Note that treetest5 for this assignment was generated
using random numbers, so
there are a number of duplicate keys, both for insert and delete. Just
insert any duplicate keys. That way when you delete any duplicate keys, each
will be deleted and you won't generate any "search key not found" messages.
Also, to give you an idea of the result of treetest5,
you should end up with
a well balanced tree of 30 nodes with black root 306.
It is not necessary to echo delete (or insert) operations (though you
might want to echo them for debugging purposes - you can turn off the
echoing once your program is running correctly). However you should
print appropriate messages for successful and unsuccessful searches
(there will be about 100 of these in treetest4 -- and
fewer in the other tests).
What To Hand In:
- Clearly marked scripts of test runs using treetest3,
treetest4, and treetest5
demonstrating your
red-black tree implementation. Be sure to hand-draw the tree edges.
- Well documented code for your red-black tree implementation.
Part 2: Red-black tree and B-tree Exercises (10 points)
- Do Exercise 13.1-4, page 276.
- Answer the questions of Exercise 13.1-4 for AA-trees,
which are discussed (very briefly) at the top of page 301.
Hint: the answer to the first question is in the previous
paragraph on page 300.
- Do Exercise 18.3-2, page 452.
Page URL: http://www.d.umn.edu
/~ddunham/cs4521f05/assignments/a8/assignment.html
Page Author: Doug Dunham
Last Modified: Tuesday, 25-Oct-2005 16:18:12 CDT
Comments to: ddunham@d.umn.edu