Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

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 > > AbstractBinaryTree< T, RedBlackNode< T > > List of all members.

Public Member Functions


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 Wed Jul 28 17:23:53 2004 for vdk 2.0.3 by doxygen 1.3.7