Can every recursion be converted into iteration?

前端 未结 17 2307
遥遥无期
遥遥无期 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:17

    Yes, using explicitly a stack (but recursion is far more pleasant to read, IMHO).

提交回复
热议问题