New RedBlack Tree Test Demonstration
Instructions for running the animation
- Choose a data set from the list or
- Choose User input
- Click Run or Step to run the animation.
- At the end of the original additions, you may elect to
add more items or delete items already in the tree.
- Choose Actions:Add or Actions:Delete
- Enter a single integer in the box
- Click OK
The appropriate node will be added or deleted. The input box will
remain visible so that you can add or delete further nodes.
- Choose Stop to end the current animation and start again.
User input
- Enter a space separated list of numbers in the text box, eg
1 2 4 5 6
Your input must be integers separated by spaces: currently the system is
rather picky about this.
- Click OK (don't expect anything to happen yet!)
- Click Run or Step in the main menu.
- If your typed input is intelligible, the input box will disappear
and the animation will start.
Input files
You may add to the standard list of input files.
The first line is a string label for the data set:
it will appear in the Select menu.
This is followed by a list of integers - one to a line,
eg
Simple data set
1
3
5
6
Save this file with the name rbn, where n
is 1 greater than the last file in the series in the applet's directory.
The program looks for files rb0, rb1, etc and
stops as soon as there is a gap in the series.
Deletions
Deletions may be demonstrated using input files:
a negative number, eg -x,
is treated as a command to delete
the node with the value, x.
If there is no node, x, in the tree, an error message will be
displayed.
End of new redblack applet