Can every recursion be converted into iteration?

前端 未结 17 2531
遥遥无期
遥遥无期 2020-11-22 01:59

A reddit thread brought up an apparently interesting question:

Tail recursive functions can trivially be converted into iterative functions. Other one

17条回答
  •  天涯浪人
    2020-11-22 02:23

    Removing recursion is a complex problem and is feasible under well defined circumstances.

    The below cases are among the easy:

    • tail recursion
    • direct linear recursion

提交回复
热议问题