CS 4521 PA5 — Red-Black Trees

Due November 10, 15 points.

For this assignment you will write code for red-black tree rebalancing after node inserts and removes.

Setup

  1. First you need to download the file RedBlackTree.zip to a convenient location.
  2. Then unzip the file. This will create a NetBeans project folder.
  3. Run NetBeans and open this project.

Assignment

To complete the assignment you will need to implement code in just one class:

You will need to add code in the two methods insertRebalance() and deleteRebalance(). The places where you need to add code are indicated by "FIXME" comments.

The methods have a void return type so there are no compile-time errors in the existing code. If you run the main program as-is, it will do inserts and deletes but without any rebalancing.

Your code should make use of private methods that are already implemented for making changes to the tree. The implementations in these methods is designed to do updates of the displayed tree and the application log. You may also add log messages in the code that you write.

What to Turn in

You should turn in a copy of your code for the RedBlackBalancer class. It should have your name included in comments. You should also turn in a modified script of the program execution. You should also be prepared to demonstrate the execution of your program in lab.

Section Header

Section overview text.