亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

SearchNode(int nodeIndex) 并沒有調用遞歸呀

是不是有錯

????

正在回答

1 回答

后來改了,前面的是有錯,沒考慮周全

Node *Node::searchNode(int nodeIndex)

{

Node *temp=NULL;

if(this->index==nodeIndex) ?return this;

if(this->pLChild!=NULL)

{

if(this->pLChild->index==nodeIndex)

return this->pLChild;

else

{

temp=this->pLChild->searchNode(nodeIndex);

if(temp!=NULL) return temp;

}

}


if(this->pRChild!=NULL)

{

if(this->pRChild->index==nodeIndex)

return this->pRChild;

else

{

temp=this->pRChild->searchNode(nodeIndex);

if(temp!=NULL) return temp;

}

}

return NULL;

}


5 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

SearchNode(int nodeIndex) 并沒有調用遞歸呀

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號