Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Trees - AVLTreeBodyC<class KeyT,class DataT>
 

  PUBLIC
AVLTreeBodyC::AVLTreeBodyC(void)
AVLTreeBodyC::Insert(const KeyT &,const DataT &,bool)
AVLTreeBodyC::Remove(const KeyT &)
AVLTreeBodyC::AVLInsert(BinaryTreeNodeC *,const KeyT &,const DataT &,bool)
AVLTreeBodyC::SingleRotateWith0(BinaryTreeNodeC *)
AVLTreeBodyC::SingleRotateWith1(BinaryTreeNodeC *)
AVLTreeBodyC::DoubleRotateWith0(BinaryTreeNodeC *)
AVLTreeBodyC::DoubleRotateWith1(BinaryTreeNodeC *)
BinaryTreeBodyC::Copy(void) const
BinaryTreeBodyC::Empty(void)
BinaryTreeBodyC::Size(void) const
BinaryTreeBodyC::IsEmpty(void) const
BinaryTreeBodyC::Find(const KeyT &,DataT &)
BinaryTreeBodyC::MinData(void)
BinaryTreeBodyC::MaxData(void)
BinaryTreeBodyC::MinKey(void) const
BinaryTreeBodyC::MaxKey(void) const
BinaryTreeBodyC::Remove(const KeyT &)
BinaryTreeBodyC::Insert(const KeyT &,const DataT &,bool)
BinaryTreeBodyC::Dump(ostream &)
BinaryTreeBodyC::MinNode(void) const
BinaryTreeBodyC::MaxNode(void) const
BinaryTreeBodyC::FindNode(const KeyT &)
RCBodyC::References(void) const
RCBodyC::Copy(void) const
RCBodyC::DeepCopy(UIntT) const
RCBodyC::IncRefCounter(void)
RCBodyC::DecRefCounter(void)

   AVLTreeBodyC<class KeyT,class DataT>   
 
AVL tree body.
 
include "Ravl/AVLTree.hh"
Source file:Ravl/Core/Container/Trees/AVLTree.hh
User Level:Develop
Library:RavlCore
Example:exAVLTree.cc
In Scope:RavlN

Parent Classes: Methods:
AVLTreeBodyC()
Default constructor.

bool Insert(const KeyT & key,const DataT & dat,bool overwrite = true)
Insert a node into the tree.
If 'overwrite' is true, and a node with the given key is already in the tree then it will be overwritten otherwise 'false' will be returned.

bool Remove(const KeyT & key)
Remove an item from tree.

BinaryTreeNodeC<KeyT,DataT> * AVLInsert(BinaryTreeNodeC<KeyT,DataT> * node,const KeyT & key,const DataT & dat,bool overwrite = true)

BinaryTreeNodeC<KeyT,DataT> * SingleRotateWith0(BinaryTreeNodeC<KeyT,DataT> * node)
Do a single rotation with child 0.
'node' must have a child 0.

returns new root.


BinaryTreeNodeC<KeyT,DataT> * SingleRotateWith1(BinaryTreeNodeC<KeyT,DataT> * node)
Do a single rotation with child 1.
'node' must have a child 1.

returns new root.


BinaryTreeNodeC<KeyT,DataT> * DoubleRotateWith0(BinaryTreeNodeC<KeyT,DataT> * node)
Do a single rotation with child 0.
'node' must have a child 0.

returns new root.


BinaryTreeNodeC<KeyT,DataT> * DoubleRotateWith1(BinaryTreeNodeC<KeyT,DataT> * node)
Do a single rotation with child 1.
'node' must have a child 1.

returns new root.


#include "Ravl/BinaryTree.hh"
RCBodyC & Copy() const
Make copy of tree.

void Empty()
Empty the tree of all contents.

SizeT Size() const
Number of elements in tree.

bool IsEmpty() const
Is tree empty ?

bool Find(const KeyT & key,DataT & result)
Find a data item with 'key' in the tree.
return true if found, false otherwise.

DataT & MinData()
Get the data with smallest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

DataT & MaxData()
Get the data at the largest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

const KeyT & MinKey() const
Get the smallest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

const KeyT & MaxKey() const
Get the largest key in the tree.
Note, the tree must NOT be empty, this can be checked with IsEmpty().

bool Remove(const KeyT & key)
Remove an item from tree.

bool Insert(const KeyT & key,const DataT & dat,bool overwrite = true)
Insert a node into the tree.
If 'overwrite' is true, and a node with the given key is already in the tree then it will be overwritten otherwise 'false' will be returned.

void Dump(ostream & out)
Dump the stream in a human readable fomat.
Usefull for debuging.

BinaryTreeNodeC<KeyT,DataT> * MinNode() const
Get the node with the smallest key.

BinaryTreeNodeC<KeyT,DataT> * MaxNode() const
Get the node with the largest key.

BinaryTreeNodeC<KeyT,DataT> * FindNode(const KeyT & key)
Find a node in the tree.

#include "Ravl/RefCounter.hh"
UIntT References() const
Access count of handles open to this object.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void IncRefCounter()
Increment reference counter.

bool DecRefCounter()
Decrement reference counter.


Maintainer:Charles Galambos, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002