binary tree 計算高度 - 考試
By Todd Johnson
at 2017-05-20T13:27
at 2017-05-20T13:27
Table of Contents
演算法的內容是這樣的
int height(Node*T)
{
if(T==null)return 0;
else
{
int hL=height(T->Lchild);
int hR=height(T->Rchild);
return max(hL,hR)+1;
}
}
想請問他的遞迴到底是怎麼運作的,
思考了很久還是不知到他遞迴是怎麼跑的…
可以麻煩大家幫小弟解答嗎?
謝謝大家!
--
int height(Node*T)
{
if(T==null)return 0;
else
{
int hL=height(T->Lchild);
int hR=height(T->Rchild);
return max(hL,hR)+1;
}
}
想請問他的遞迴到底是怎麼運作的,
思考了很久還是不知到他遞迴是怎麼跑的…
可以麻煩大家幫小弟解答嗎?
謝謝大家!
--
Tags:
考試
All Comments
By Gilbert
at 2017-05-20T20:01
at 2017-05-20T20:01
By Elizabeth
at 2017-05-22T20:18
at 2017-05-22T20:18
By Barb Cronin
at 2017-05-26T22:50
at 2017-05-26T22:50
Related Posts
人身保險高分過
By Audriana
at 2017-05-20T11:23
at 2017-05-20T11:23
高業電腦考試
By Iris
at 2017-05-19T23:13
at 2017-05-19T23:13
107建國後中/後西醫 特價券
By Lydia
at 2017-05-19T21:27
at 2017-05-19T21:27
曾正生物/梁傑有機(中國醫後中上榜)
By Oscar
at 2017-05-19T21:18
at 2017-05-19T21:18
會計師考試 中會及審計老師 推薦
By Leila
at 2017-05-19T19:43
at 2017-05-19T19:43