Red/Black Tree Demonstration: Maintenance Version


Attention! The red/black demo has been updated. To see the new demo point to http://www.ece.uc.edu/~franco/C321/html/RedBlack/redblack.html. The tester for that version is found at http://gauss.ececs.uc.edu/RedBlackTester/redblack.html.

Usage: Type an integer into the text field. Click on the Add Node button to begin insertion of a red node with the specified integer value. Click on the Next Step button to see what happens on the next iteration of insertion. Click on the Restart button to start from an empty tree. To delete a node, click on the Delete Node button, then click on the node you wish to delete. The node should turn green. Click on the Next Step button repeatedly to see the steps involved in deleting the node. The delete feature is not fully implemented and some deletions may result in trees that lose their red/black properties. Click on the Undo button to restore the tree to it's state before the last node was inserted or deleted. Click on a node then click on the Color It button to reverse its color but watch it because trying to add to or delete from a non-red-black tree may have unpredictable results. See any elementary data structures text for a description of the rules of insertion and deletion including rotation and color reversals.

Source Code: The source code shows how to start the applet with a pre-built tree. RB.java.