class Node {
public:
int key;
Node *parent;
std::vector<Node *> children;
Node() {
this->parent = NULL;
}
void setParent(Node *theParent) {
parent = theParent;
parent->children.push_back(this); // I can't understand this.
}
};
Dalam fungsi setParent, di parent-›children.push_back(this), mengapa kita meneruskan ini sebagai parameter dan apa fungsinya?