Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as C++ by lab5-b1 ( 8 years ago )
class TreeNode {
private:
string character;
int count;
TreeNode* left = NULL;
TreeNode* right = NULL;
public:
TreeNode(string character) {
this->character = character;
count = 1;
};
TreeNode(char character) {
this->character = character;
count = 1;
}
~TreeNode() {
character = "";
count = 0;
left = right = NULL;
}
void increaseCount() {
count++;
}
int getCount() {
return count;
}
void setCount(int newCount) {
this->count = newCount;
}
string getChar() {
return this->character;
}
void setChar(string newChar) {
this->character = newChar;
}
TreeNode* getLeft() {
return this->left;
}
void setLeft(TreeNode* newLeft) {
this->left = newLeft;
}
TreeNode* getRight() {
return this->right;
}
void setRight(TreeNode* newRight) {
this->right = newRight;
}
};
Revise this Paste