| www.delorie.com/gnu/docs/avl/libavl_108.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Traversal is largely unchanged from BSTs. However, we can be confident that the tree won't easily exceed the maximum stack height, because of the AVL balance condition, so we can omit checking for stack overflow.
<@xref{\NODE\, , BST traverser refresher; bst =>.> avl,62}
<@xref{\NODE\, , BST traverser null initializer; bst =>.> avl,64}
<@xref{\NODE\, , AVL traverser least-item initializer.>,180}
<@xref{\NODE\, , AVL traverser greatest-item initializer.>,181}
<@xref{\NODE\, , AVL traverser search initializer.>,182}
<@xref{\NODE\, , AVL traverser insertion initializer.>,179}
<@xref{\NODE\, , BST traverser copy initializer; bst =>.> avl,69}
<@xref{\NODE\, , AVL traverser advance function.>,183}
<@xref{\NODE\, , AVL traverser back up function.>,184}
<@xref{\NODE\, , BST traverser current item function; bst =>.> avl,74}
<@xref{\NODE\, , BST traverser replacement function; bst =>.> avl,75}
|
We do need to make a new implementation of the insertion traverser initializer. Because insertion into an AVL tree is so complicated, we just write this as a wrapper to avl_probe(). There probably wouldn't be much of a speed improvement by inlining the code anyhow:
We will present the rest of the modified functions without further comment.
Exercises:
1. Explain the meaning of this ugly expression, used in avl_t_insert():
[answer]
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |