Topic: Balancing AVL trees


Author: flash@dcs.qmw.ac.uk (Leach)
Date: 3 Feb 1995 12:20:33 GMT
Raw View
I have just implemented a binary tree class. As efficiency is important I need
to balance the trees. My problem is that I can not find the algorithm to do so,
and being an enept comp sci student can not write it myself. Has anyone got
a pseudo-algorithm it does not have to be in C++.

thanks

ADAM.





Author: russgold@netaxs.com (Russell Gold)
Date: Sat, 04 Feb 1995 22:04:50 -0500
Raw View
In article <3gt72h$8f4@epsilon.qmw.ac.uk>, flash@dcs.qmw.ac.uk (Leach) wrote:

> I have just implemented a binary tree class. As efficiency is important I need
> to balance the trees. My problem is that I can not find the algorithm to
do so,
> and being an enept comp sci student can not write it myself. Has anyone got
> a pseudo-algorithm it does not have to be in C++.

Check your Comp-Sci library for Knuth's "The Art of Computer Programming",
vol. 3: Sorting and Searching. The AVL algorithm is described on pages
451-469.
------------------------------------------------------------------------
Russell Gold                     | "... society is tradition and order
russgold@netaxs.com (preferred)  | and reverence, not a series of cheap
russgold@aol.com                 | bargains between selfish interests."
russgold@boeing.com              |