The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

recursive -> iterative by dennismv2004-12-21 02:24:43
  I think it would work by moddermonster2004-12-21 07:10:53
    You're forgetting something by Liava 2004-12-21 11:55:08
That is just one example of recursion. Consider something like this:
void foo(bar) {
    if (x)
        foo(baz1);
    else
        foo(baz2);
}
Or multiple recursive calls for each recursion (e.g. quicksort and mergesort).

But, as I explained cross-thread, relying on a stack to do your recursion doesn't change the fact that it is recursive (since you are still solving sub-problems and combining them to solve the larger problem).

BTW, what is "begin recursion"? The obvious definition would be that the recursive call is the very first line of the function, but that doesn't make a lot of sense, since you would never terminate.

[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)