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?
Asked
Active
Viewed 288 times
1
-
1I believe by using the stack data structure, yes, since you can just simulate the recursion stack. – Throckmorton Nov 21 '19 at 16:49
-
Oh what I can't upvote your comment... Thanks – J Arun Mani Nov 21 '19 at 16:57