Why should recursion be preferred over iteration?

前端 未结 18 1188
既然无缘
既然无缘 2020-11-29 18:50

Iteration is more performant than recursion, right? Then why do some people opine that recursion is better (more elegant, in their words) than iteration? I really don\'t see

18条回答
  •  醉梦人生
    2020-11-29 19:48

    Here is some information on the pros & cons of recursion & iteration in c:

    http://www.stanford.edu/~blp/writings/clc/recursion-vs-iteration.html

    Mostly for me Recursion is sometimes easier to understand than iteration.

提交回复
热议问题