David M. Howard dmh2000@cwix.com
Sun Microsystems Certified Java Developer
This applet animates the building of a binary search tree. 20 values are inserted into the tree in increasing order, which is a pathological case for this data structure. The tree degenerates into a linear linked list.A rebalance of the tree is performed using a simple recursive rebalancing algorithm that is O(N) (Sedgewick,1998). The blue nodes highlight the nodes/subtree that changed on the most recent pass thru the tree.
|
David Howard October 1998