|
I implemented the Adelson-Velskii and Landis (AVL)
binary search tree in Ada 95 as a generic package some time ago. I
performed some tests on it and it seemed to work correctly. I have not
tested it extensively. This would be a useful package for many government
projects. However, due to its heavy use of pointers, I would not recommend
it for safety-critical applications. I also have a PowerPoint presentation
providing an overview of the AVL Tree algorithm. It is provided as a
self-extracting archive and requires PowerPoint 97/2000 or newer to view it.
This generic package, when instantiated, will
itself provide a generic Visit() function. This allows a client to
instantiate any function desired to be executed on each node of the instantiated
AVL tree.
This implementation is unique in that it
provides the implementation of the Delete function. This is very hard to
find in books and other resources.
No guarantees are provided with this code
either expressed or implied. I accept no liability for any damages or
losses incurred through the use of this code. I would advise you to
thoroughly test this code for yourself before committing to use it on an
important project.
Download
the AVL Tree Generic Package (self-extracting exe).
Enjoy. George
|