如果樹的深度特別大,用遞歸會有內存和performance的問題,而且有可能引起stack overflow,
可以考慮用list and stack
這個真的不能用遞歸
所有跟帖:
•
阿牛人!沒見你再扔炸彈?最近怎個情況?
-眼冒金星-
♂
(0 bytes)
()
03/06/2013 postreply
21:57:02
•
還行,該幹什麽就幹什麽
-村口阿牛-
♂
(0 bytes)
()
03/06/2013 postreply
22:04:58
•
好心態。
-眼冒金星-
♂
(0 bytes)
()
03/06/2013 postreply
23:58:48
•
實際深度不大,測試performance沒有問題。
-胡問之-
♀
(128 bytes)
()
03/06/2013 postreply
22:24:54
•
every recursive problem has an iterative :)
-神馬聊天-
♂
(0 bytes)
()
03/08/2013 postreply
07:50:44