I've read in books, and heard from other people; that recursion is a terrible decision. I sort of agree in certain situations. But say you have something like this... What's so bad about using recusion?
Code:int i = 0; if (i >= 10) { } else { System.out.println(i + ""); i++; }
vs some looping like this:
Code:int i = 0; while (i != 10) { System.out.println(i + ""); i++; }
I just don't understand why recursion is a worse decision than choosing a looping or iterative type structure...
<Moderator added green checkmark in the first thread>




Reply With Quote