NAME

OTC_AVLTree - The root class of a height balanced AVL tree.

SYNOPSIS


#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;
};

CLASS TYPE

Concrete

DESCRIPTION

This class is the root class of a height balanced AVL tree. It is this class which holds the root node in the tree and maintains the population count for the tree. The generic AVL tree structure does not actually provide the capability to hold any items. Instead it only maintains the balance of the tree and ensures the integrity of the tree structure. In order for the tree structure to actually hold items, a specific node class must be derived from the 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.

DESTRUCTION

~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;

SEE ALSO

OTC_AVLNode, OTC_AVLLinkNode

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

Copyright 1992 1993 OTC LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED