NAME

OTC_AVLNode - Base class for nodes within an AVL tree.

SYNOPSIS


#include <OTC/collctn/avlnode.hh>

class OTC_AVLNode : public OTC_MPObject
{
  public:
    virtual ~OTC_AVLNode();
    inline OTC_AVLNode* father() const;
    inline OTC_AVLTree* tree() const;
    inline OTC_Boolean isRoot() const;
    inline OTC_AVLNode* left() const;
    inline OTC_AVLNode* right() const;
    inline OTC_Boolean isLeft() const;
    inline OTC_Boolean isRight() const;
    OTC_AVLNode* brother() const;
    u_int level() const;
    inline u_int count() const;
    u_int index() const;
    u_int height() const;
    void addBefore(OTC_AVLNode* theNode);
    void addAfter(OTC_AVLNode* theNode);
    void swap(OTC_AVLNode* theNode);
    void unlink();
  protected:
    OTC_AVLNode();
};

CLASS TYPE

Abstract

DESCRIPTION

This class is the base class for nodes within an AVL tree. All nodes to be placed into such a tree must be derived from this class. It is this class which encapsulates all the operations which can be performed on a tree and nodes within it. Of these operations, those which involve insertion or deletion of nodes will automatically rebalance the tree as required.

DESTRUCTION

virtual ~OTC_AVLNode();

QUERY

inline OTC_AVLNode* father() const;
inline OTC_AVLTree* tree() const;
inline OTC_Boolean isRoot() const;
inline OTC_AVLNode* left() const;
inline OTC_AVLNode* right() const;
inline OTC_Boolean isLeft() const;
inline OTC_Boolean isRight() const;
OTC_AVLNode* brother() const;
u_int level() const;
inline u_int count() const;
u_int index() const;
u_int height() const;

MODIFICATION

void addBefore(OTC_AVLNode* theNode);
void addAfter(OTC_AVLNode* theNode);
void swap(OTC_AVLNode* theNode);
void unlink();

SEE ALSO

OTC_AVLTree

LIBRARY

OTC

AUTHOR(S)

Graham Dumpleton

COPYRIGHT

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