// avl-heights.h // class definition file for class AVLNode with height values // Steve Tanimoto, 11 Nov 1999. class AVLNode { private: int balance; // 0 means balanced, -1 means left-heavy, 1 means right-heavy int height; int key; char *info; public: AVLNode *LC; AVLNode *RC; AVLNode(); AVLNode(int theKey, char *theInfo): balance(0), height(0), key(theKey), info(theInfo), LC(NULL), RC(NULL) { } int getBalance(); void setBalance(int theBalance); int getHeight(); void setHeight(int theHeight); int getKey(); void setKey(int theKey); char *getInfo(); void setInfo(char *theInfo); void printInOrder(); void printTreeShape1(int depth); void printTreeShape(); void BSTInsert(int theKey, char *theInfo); int AVLInsert(int theKey, char *theInfo, AVLNode **parentsChildPointer); void AVLDelete(int theKey); AVLNode *find(int theKey); AVLNode *findNodeAndParent(int theKey, AVLNode *myParent, AVLNode **foundParent); AVLNode *inOrderSuccessorForAVLDelete(AVLNode **foundParent); void rotateLeft(AVLNode **parentsChildPointer); void rotateRight(AVLNode **parentsChildPointer); void singleRotateLeft(AVLNode **parentsChildPointer); void singleRotateRight(AVLNode **parentsChildPointer); void doubleRotateLeftRight(AVLNode **parentsChildPointer); void doubleRotateRightLeft(AVLNode **parentsChildPointer); void figureHeight(); };