if n=0,F(n)=5
if n=1,F(n)=12
if n>1 and n mod 2 = =0 ,F(n)=F(n-1)+F(n-2)
if n>1 and n mod 2 = =1 ,F(n)=F(n-1)*F(n-2)+2*F(n-3)
perform recursive evaluation process of F(3) in a tree structure form of
recursive calls f(...).
ans:
應該是要畫遞洄流程樹狀圖吧?
F(3) F(3)
/ \ / | \
* * F(2) F(1) F(0)
/ \ / \ / \
F(2) F(1) 2 F(0) F(1) F(0)
/ \
F(1) F(0)
請問畫出來是左圖還是右圖
或都不是= =
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.69.54.7