home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 March / ENTER.ISO / files / fwp-0.0.6-win32-installer.exe / Bintree.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-12-06  |  558 b   |  36 lines

  1. #ifndef __Bintree_h__
  2. #define __Bintree_h__
  3.  
  4. class BintreeNode{
  5. public:
  6.     BintreeNode(float key, void* object);
  7.     ~BintreeNode();
  8.  
  9.     BintreeNode* parent;
  10.     BintreeNode* leftChild;
  11.     BintreeNode* rightChild;
  12.  
  13.     float key;
  14.     void* object;
  15.  
  16.     void buildInOrderArray(int& pos, BintreeNode** array);
  17. };
  18.  
  19.  
  20. class Bintree{
  21. public:
  22.     Bintree();
  23.     ~Bintree();
  24.  
  25.     BintreeNode* root;
  26.     BintreeNode** inOrderArray;
  27.     int numNodes;
  28.  
  29.     void insert(float key, void* object);
  30.  
  31.     void clearTree();
  32.     void buildInOrderArray();
  33. };
  34.  
  35. #endif    /* __Bintree_h__ */
  36.