The
inset below illustrates the behavior of an AVL-balanced
tree. You can insert, delete and locate nodes in the tree
using control buttons. All operations are animated. If an
action is initiated when another animation is still
running, the current task is expedited allowing the new
animated process to start. The data can be entered
manually or randomly generated. By pressing
<Insert> button only, you can quickly build a large
tree. If the <AVL> option is not checked, the
algorithm will no longer balance the tree after
insertions and deletions. If this option is enabled for
an existing structure, the whole tree will be
rebalanced.
Feel free to play with the
tree and grab individual nodes with your mouse. The
applet will point out the previous and next nodes
depending on the selected traversal method. Changing
<Shape> will be useful when the tree grows larger.
You can also <Shake> the tree to keep the bugs out.