avltree.h
// Copyright (c) 2016 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_AVLTREE_H
#define RUDIMENTS_AVLTREE_H
#include <rudiments/private/avltreeincludes.h>
template <class valuetype>
class avltreenode {
public:
avltreenode(valuetype value);
~avltreenode();
valuetype getValue() const;
int32_t compare(valuetype value) const;
int32_t compare(avltreenode<valuetype> *peer) const;
avltreenode<valuetype> *getParent();
avltreenode<valuetype> *getLeftChild();
avltreenode<valuetype> *getRightChild();
uint8_t getLeftHeight();
uint8_t getRightHeight();
avltreenode<valuetype> *getPrevious();
avltreenode<valuetype> *getNext();
void print() const;
#include <rudiments/private/avltreenode.h>
};
template < class valuetype >
class avltree {
public:
avltree();
~avltree();
void insert(valuetype value);
void insert(avltreenode<valuetype> *node);
avltreenode<valuetype>
*detach(avltreenode<valuetype> *node);
bool remove(valuetype value);
bool removeAll(valuetype value);
bool remove(avltreenode<valuetype> *node);
uint64_t getLength() const;
avltreenode<valuetype> *getTop();
avltreenode<valuetype> *getFirst();
avltreenode<valuetype> *getLast();
avltreenode<valuetype> *getPrevious(
avltreenode<valuetype> *node);
avltreenode<valuetype> *getNext(
avltreenode<valuetype> *node);
avltreenode<valuetype> *find(valuetype value);
avltreenode<valuetype>
*find(avltreenode<valuetype> *startnode,
valuetype value);
void clear();
void print() const;
#include <rudiments/private/avltree.h>
};
#include <rudiments/private/avltreeinlines.h>
#endif
avltreenode::print
void print() const
avltreenode::getNext
avltreenode< valuetype > * getNext()
avltree
Definition: avltree.h:77
avltreenode::getLeftChild
avltreenode< valuetype > * getLeftChild()
avltreenode::getValue
valuetype getValue() const
avltreenode::getLeftHeight
uint8_t getLeftHeight()
avltreenode::getPrevious
avltreenode< valuetype > * getPrevious()
avltreenode::getParent
avltreenode< valuetype > * getParent()
avltreenode::getRightChild
avltreenode< valuetype > * getRightChild()
avltreenode::avltreenode
avltreenode(valuetype value)
avltreenode::~avltreenode
~avltreenode()
avltreenode
Definition: avltree.h:11
avltreenode::compare
int32_t compare(valuetype value) const
avltreenode::getRightHeight
uint8_t getRightHeight()