Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

VDKBtree< T > Class Template Reference

provides a templatized binary tree data structure. More...

#include <vdkbtrees.h>

Inheritance diagram for VDKBtree< T >:

AbstractRedBlackTree< T, RedBlackNode< T > > List of all members.

Public Methods


Detailed Description

template<class T>
class VDKBtree< T >

provides a templatized binary tree data structure.

Description
VDKBtree<T> class has a value semantic, all objects are copied from original values. VDKBtree<T> class implements red/black balanced trees. All managed type T objects should provide:
Implementation notes
I suggest to use typedef's like:
  typedef VDKBtree<someClass> SomeClassBtree;
Programming tips
Here an example how to construct, fill and trasverse a btree
  #define LEN 10
  typedef VDKBtree<int> intbt;
  int v[LUNG] = { 3, 5, 7, 2, 1, 4, 45, 6, 23, 6 };
  int main(int , char **) 
  {
   intbt btree;
   // add nodes to tree
   for (t=0; t < LEN ;t++)
     btree.add(v[t]);
   // makes an iterator
   intbt::Iterator iter(btree);
   for (; iter;iter++)
     {
     int i = iter.current();
     // make whatever with i
     }
   // removes all nodes
   for (t=0; t < LEN; t++)
     btree.unlink(v[t]); 
  }
EXAMPLES
in ./example/template/ttest.cc


Constructor & Destructor Documentation

template<class T>
VDKBtree< T >::VDKBtree   [inline]
 

Constructor, makes an empty tree


The documentation for this class was generated from the following file:
Generated on Sat May 4 21:58:27 2002 for vdk 2.0.1 by doxygen1.2.15