#include <avl.hxx>
Inheritance diagram for AvlTree< KeyType >:

Public Types | |
| typedef int(* | AvlIterFunc )(NodeType *) |
Public Member Functions | |
| AvlTree () | |
| ~AvlTree () | |
| void | insert (const KeyType &key) |
| NodeType * | choose () |
| NodeType * | least () |
| NodeType * | greatest () |
| void | remove (NodeType &node) |
| NodeType * | lookup (const KeyNodeType &key) |
| NodeType * | lookup (KeyType key) |
| NodeType * | lookupGLE (const NodeType &key) |
| NodeType * | lookupGLE (KeyType key) |
| void | iterate (AvlIterFunc avlFunc) |
Definition at line 218 of file avl.hxx.
|
|||||
|
Reimplemented from BaseAvlTree. |
|
|||||||||
|
|
|
|||||||||
|
|
|
|||||||||
|
Selects an arbitrary node from within the avl tree (if any) and returns it, or NULL if no nodes remain. The returned node remains in the tree. Reimplemented from BaseAvlTree. |
|
|||||||||
|
Returns the least node in the avl tree (if any) or NULL. The returned node remains in the tree. Reimplemented from BaseAvlTree. |
|
||||||||||
|
Insert a new node into an existing AVL tree. The lchild/rchild fields of the inserted node will be set to NULL prior to insertion. |
|
||||||||||
|
Reimplemented from BaseAvlTree. Definition at line 309 of file avl.hxx. References BaseAvlTree::iterate(). |
|
|||||||||
|
Returns the least node in the avl tree (if any) or NULL. The returned node remains in the tree. Reimplemented from BaseAvlTree. |
|
||||||||||
|
Definition at line 285 of file avl.hxx. References AvlTree< KeyType >::lookup(). |
|
||||||||||
|
Test whether and existing value exists within an AVL tree. It may seem wasteful that the client must supply an BaseAvlNode rather than some more compact AvlKey structure. In our experience with tree structures it is usually the case that the search key structure is stack allocated. Since the only fields that need to be initialized are the ones consulted by the comparator routine, allocating a full BaseAvlNode actually isn't any more expensive -- it just bumps the stack by a few more words. The advantage of reusing the BaseAvlNode structure for this purpose is that it allows the tree itself to remain completely agnostic about key types and value types. Definition at line 281 of file avl.hxx. Referenced by AvlTree< KeyType >::lookup(). |
|
||||||||||
|
Definition at line 297 of file avl.hxx. References AvlTree< KeyType >::lookupGLE(). |
|
||||||||||
|
Similar to avl_lookup(), but returns the BaseAvlNode whose key is the greatest (according to provided comparator) key less than or equal to the search key. Definition at line 293 of file avl.hxx. Referenced by AvlTree< KeyType >::lookupGLE(). |
|
||||||||||
|
Remove a node from an AVL tree. On return, the node structure has been freed. |
1.4.6