Lab 2 -- Building Red-Black Trees
Due: at the end of lab
Objective: Practice building Red-Black trees
Applet to use to check your work.
This is the one I used in class that I like a little better:
Build these Red-Black trees
- 8, 5, 12, 3, 2, 1
- 82, 75, 98, 60, 79, 80, 65, 62
- 48, 76, 27, 52, 87, 50, 51, 92, 49, 90
- 4, 2, 6, 5, 7, 16, 15, 14, 13, 12, 8, 10
Hand in:
Hand in your diagrams of trees, showing the rotations, reasonably neat.
It is expected that every diagram will be correct, since you can check it
with the applets.
OutLab Due on Tuesday at the beginning of lab class.
Use the code I have given you for Red/Black
trees and implement the delete method.
- The algorithm is in your book (I'll hand out another example).
- If needed it should handle color changes and rotations if the balance is knocked off after a deletion.
- Add a inorder print method also, you should have already written this in a previous lab.
- Turn in the code by email at the beginning of Tuesday's lab class.