#include <OTC/collctn/avltree.hh> class OTC_AVLTree : public OTC_Resource {
public:
static os_typespec* get_os_typespec();
~OTC_AVLTree();
OTC_AVLTree();
inline OTC_Boolean isEmpty() const;
inline u_int population() const;
void removeAll();
inline OTC_AVLNode* root() const;
void addRoot(OTC_AVLNode* theNode);
int depth() const;
OTC_AVLNode* node(u_int theIndex) const;
};
OTC_AVLNode
class. An example of such a class is the
OTC_AVLLinkNode
class, which holds a pointer to a link
within a linked list.
~OTC_AVLTree();
OTC_AVLTree();
inline OTC_Boolean isEmpty() const;
OTCLIB_TRUE
if the tree is empty.
inline u_int population() const;
void removeAll();
inline OTC_AVLNode* root() const;
0
if the tree
is empty.
void addRoot(OTC_AVLNode* theNode);
1
.
If this is invoked when the tree is not
empty, an exception is raised.
int depth() const;
0
. If the tree is
empty, then -1
is returned.
OTC_AVLNode* node(u_int theIndex) const;
0
is returned.
Otherwise the node with index theIndex
,
based on an inorder traversal, is returned.
Indexes start at 0
.
OTC_AVLNode
, OTC_AVLLinkNode