Rudiments
|
#include <avltree.h>
Inherits treecollection< valuetype >.
The avltree class allows you to store an arbitrary number of values in a self-sorting, self-balancing binary tree. Since the avltree class is template-based, you can store arbitrary types of values.
Each avltree is composed of a set of avltreenodes. Each avltreenode contains a value.
Creates an empty instance of the avltree class.
Creates an instance of the avltree class that is a copy of "a".
Creates an instance of the avltree class that is a copy of "a".
Creates an instance of the avltree class that is a copy of "a".
Deletes this instance of the avltree class and all of its avltreenodes.
The value stored in each avltreenode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Deletes all avltreenodes currently in the avltree.
The value stored in each avltreenode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Always returns true.
Implements collection.
Detaches "node" from the tree.
Implements treecollection< valuetype >.
|
inlinevirtual |
Returns a pointer to the first avltreenode below "startnode" containing "value" or NULL if "value" was not found.
Implements treecollection< valuetype >.
Returns a pointer to the first avltreenode containing "value" or NULL if "value" was not found.
Implements treecollection< valuetype >.
Returns the number of nodes in the avltree.
Implements collection.
Returns the first node in the avltree (in an in-order, depth-first traversal).
Implements treecollection< valuetype >.
Returns the last node in the avltree (in an in-order, depth-first traversal).
Implements treecollection< valuetype >.
Returns the node after "node" or NULL if this node is the last node in the tree (in an in-order, depth-first traversal). "node" is presumed to be in the tree.
Implements treecollection< valuetype >.
|
inlinevirtual |
Returns the node prior to "node" or NULL if this node is the first node in the tree (in an in-order, depth-first traversal). "node" is presumed to be in the tree.
Implements treecollection< valuetype >.
Returns the top-most node in the avltree.
Implements treecollection< valuetype >.
Inserts already created avltreenode "node" to the avltree.
Implements treecollection< valuetype >.
Creates a new avltreenode containing "value" and prepends it to the avltree.
Implements treecollection< valuetype >.
Makes this instance of the avltree class identical to "a".
|
inline |
Makes this instance of the avltree class identical to "a".
|
inline |
Makes this instance of the avltree class identical to "a".
Removed avltreenode "node" from the avltree.
The value stored in the avltreenode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Note that this operation does not require a search and is far less expensive than the remove(value) operation and removeAll().
Returns true on success and false on failure.
Implements treecollection< valuetype >.
Deletes the first avltreenode containing "value".
The value stored in the avltreenode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Note that this operation requires a search and is expensive in both execution time and code size.
Returns true on success and false on failure.
Implements treecollection< valuetype >.
Deletes all avltreenodes containing "value".
The value stored in each avltreenode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Note that this operation requires a search and is expensive in both execution time and code size.
Returns true on success and false on failure.
Implements treecollection< valuetype >.