如果树的深度特别大,用递归会有内存和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