1 /* 2 *_________________________________________________________________________* 3 * POEMS: PARALLELIZABLE OPEN SOURCE EFFICIENT MULTIBODY SOFTWARE * 4 * DESCRIPTION: SEE READ-ME * 5 * FILE NAME: poemstreenode.h * 6 * AUTHORS: See Author List * 7 * GRANTS: See Grants List * 8 * COPYRIGHT: (C) 2005 by Authors as listed in Author's List * 9 * LICENSE: Please see License Agreement * 10 * DOWNLOAD: Free at www.rpi.edu/~anderk5 * 11 * ADMINISTRATOR: Prof. Kurt Anderson * 12 * Computational Dynamics Lab * 13 * Rensselaer Polytechnic Institute * 14 * 110 8th St. Troy NY 12180 * 15 * CONTACT: anderk5@rpi.edu * 16 *_________________________________________________________________________*/ 17 18 #ifndef TREENODE_H 19 #define TREENODE_H 20 21 //#define NULL 0 22 23 24 //Tree depends on TreeNode 25 class Tree; 26 27 // declares a tree node object for a binary tree 28 class TreeNode{ 29 30 private: 31 // points to the left and right children of the node 32 TreeNode *left; 33 TreeNode *right; 34 35 int balanceFactor; 36 int data; 37 void * aux_data; 38 public: 39 // make Tree a friend because it needs access to left and right pointer fields of a node 40 friend class Tree; 41 TreeNode * Left(); 42 TreeNode * Right(); 43 int GetData(); GetAuxData()44 void * GetAuxData() {return aux_data;}; SetAuxData(void * AuxData)45 void SetAuxData(void * AuxData) {aux_data = AuxData;}; 46 int GetBalanceFactor(); 47 TreeNode(const int &item, TreeNode *lptr, TreeNode *rptr, int balfac = 0); 48 //friend class DCASolver; 49 }; 50 51 #endif 52 53