Recall that the description of the AVL tree project contains information about the series of projects that includes this one and the next, as well as the set-up and the code base.
The goal of this project is to understand and implement the rotations that maintain the properties of traditional red-black trees. This project appears in the book as Project 4.8 on page 267.
Finish the method TradRBBalancer.putFixup()
.
Test using TRBBSTMTest
.
This test case has two exceptions that it throws:
DoubleRedException
indicating two red nodes occurring in a row
and
InconsistentBlackHeightException
indicating a node whose
children have different black heights.
Project 4.8 also mentions implementing removeFixup()
,
but this is unassigned since we are not covering removal from
red-black trees.
Copy the files you modified (BSTMap.java
and
TradRBBalancer.java
)
to your turn-in folder /cslab/class/cs345/(your id)/trad-rb
.
To keep up with the course, this should be finished by March 25.