首页 > 其他 > 详细

Advantages & Disadvantages of Recursion

时间:2019-08-18 10:02:43      阅读:96      评论:0      收藏:0      [点我收藏+]

Recursion is a technique in which a problem is solved by itself; it‘s a technique to solve most Divide & Conquer problems.

Differences between Divide & Conquer problem and Dynamic Programming problem:

Sub-problems of DP usually have some relations, while Divide & Conquer is not.

Advantages

  • Easy to understand.

Disadvantages

  • Usually slower than iteration
  • Stack overflow risk: Each step will recursively call a function, which will significantly occupy a lot stack memory.
  • Difficult to debug and trace value.

 

Advantages & Disadvantages of Recursion

原文:https://www.cnblogs.com/ireneyanglan/p/11371286.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!