2-3-4 ツリーで明確化していただければ幸いです...次のように定義されたツリーがあるとします。
class N234{ //node class
public:
int firstData, secondData, thirdData;
N234 *firstChild,*secondChild,*thirdChild,*fourthChild,*parent;
};
class T234{ //tree with root node
public:
T234(){
this->root->parent=NULL;
this->root->firstChild=NULL;
this->root->secondChild=NULL;
this->root->thirdChild=NULL;
this->root->fourthChild=NULL;
}
private:
N234* root;
};
私の質問は、実際には、ノードの変数 (firstData、secondData、 thirdData) にすでに何らかの値がある場合に、ノードがいっぱいである (3 つの値がすべて含まれている) かどうかをどのように知ることができるかということです。
例:
ルート: |4| ルートの左の子:|1,2|
ルート |7,9| の右の子
ここで root には 1 つの値 (4) があります。私の質問は、彼の他のすべての変数 (secondData、 thirdData) には何らかの値があるため (たとえそれがゴミであっても)、実際に 1 つの値を持っていることをどのように知ることができるかということです.. よろしくお願いします!