We all know iterations and recursions are a powerful thing in programming. But this doubt always troubles me whenever I write an iteration or recursion. Can every recursive problem solved using iteration and vice-versa? We can avoid efficiency for simplicity. Only thing is is it possible for all?

  • 1
    $\begingroup$ I believe by using the stack data structure, yes, since you can just simulate the recursion stack. $\endgroup$ Commented Nov 21, 2019 at 16:49
  • $\begingroup$ Oh what I can't upvote your comment... Thanks $\endgroup$ Commented Nov 21, 2019 at 16:57


Browse other questions tagged or ask your own question.