|
Both recursion and iteration have their upsides and downsides. Recursion is less efficient but more versatile (and sometimes the only way to write an algorithm). Iteration on the other hand is simpler (in my opinion), sometimes faster, and usually more efficient (especially in terms of stack usage), but is much more limited in ability and scope. I generally prefer iteration, but like Tama said, don't restrict yourself by leaning to strongly one way or the other.
__________________
I can pick my friends. And I can pick my nose. So, why can't I pick my friend's nose?
|