Results 1 to 1 of 1
- 02-13-2013, 11:57 PM #1Member
- Join Date
- Oct 2012
- Tempe, Arizona
- Blog Entries
- Rep Power
Recursion to Iteration, and Vice Versa
Can ANY loop be translated into a recursive method? And can ANY recursive method be translated into a loop? Is there any scenario where one wouldn't be able to handle what the other can?
Several of us were talking about recursion vs iteration, and this topic came up. I was not able to remember anytime that one couldn't be replaced with the other, yet it seems like there must be a scenario where this is true. Can anyone think of a scenario where this would be true? I know one might be a lot more sloppier than the other, usually loops in my mind, but it seems like both could handle any problem... Am I wrong in thinking this?
Most sources I viewed on the Internet say that either could handle any problem, yet I remain unconvinced for some odd reason...Catching exceptions is for communists
- By besil in forum New To JavaReplies: 2Last Post: 07-10-2011, 03:07 PM
- By Ms.Ranjan in forum New To JavaReplies: 5Last Post: 04-16-2009, 06:30 PM
- By sfe23 in forum New To JavaReplies: 9Last Post: 02-19-2009, 11:37 PM
- By pheonix in forum New To JavaReplies: 2Last Post: 09-09-2008, 04:43 AM
- By abintoms in forum New To JavaReplies: 1Last Post: 08-08-2007, 12:45 AM