One way to think of red-black trees is as a representation of 2-4 trees. This demonstration shows the relationship: a red-black tree on the left corresponds to the 2-4 tree on the right. Typing a number into the “Value to insert” box (followed by “Enter”) adds it to the tree. You can back up or redo an operation using the “<<” and “>>” buttons.
|
|
Fast | Slow |
Value to insert: | ||||