Thread View: de.comp.lang.c++
2 messages
2 total messages
Started by Joost Romeu
Fri, 20 Oct 1995 19:05
Recursion vs Iteration
Author: Joost Romeu
Date: Fri, 20 Oct 1995 19:05
Date: Fri, 20 Oct 1995 19:05
16 lines
913 bytes
913 bytes
I don't understand recursion but I have a feeling about it. I'd appreciate it if you could share your understandings about recursion and iteration with me. On the face of it: - There's something very attractive about recursion. It seems a "smart" and interesting (albeit tricky and magical) way of defining, approaching, and solving a problem. - Iteration, on the other hand, seems a ploughhorse way of trudging through a problem - easy to grasp and lay down; then lots of plowing... Is this just a beginner's appreciation of a new concept or does it hold true in time. thanks (please also email reply)
Re: Recursion vs Iteration
Author: Baltasar Trancon-y-Widemann
Date: Wed, 15 Nov 1995 21:44
Date: Wed, 15 Nov 1995 21:44
34 lines
1866 bytes
1866 bytes
Joost Romeu (joost@sirius.com) wrote: : I don't understand recursion but I have a feeling about it. I'd appreciate : it if you could share your understandings about recursion and iteration : with me. : On the face of it: : - There's something very attractive about recursion. It seems a "smart" : and interesting (albeit tricky and magical) way of defining, approaching, : and solving a problem. : - Iteration, on the other hand, seems a ploughhorse way of trudging : through a problem - easy to grasp and lay down; then lots of plowing... right. Recursion is what a good computer scientist types in, iteration is what a good compiler makes of it... The second aspect is that these two concepts belong to different viewpoints of a problem: recursion is a functional approach, telling the machine that the solution of a problem depends on the solution of a very similar, hopefully simpler problem. Iteration, on the other hand, is an imperative approach, telling the machine to go ahead and solve a part of the problem then step back and apply the same methods to the next part until the problem is done. If you don't want to worry about the philosophical consequences of your bubble-sort-algorithm or who knows what -- just rely on bits of code other people wrote, and pretend to be impartial. -- -- trancon@cs.tu-berlin.de
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads