Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mathematical Challenge (Lottery)
Message
From
30/05/2003 04:57:35
Walter Meester
HoogkarspelNetherlands
 
 
To
15/05/2003 06:46:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00785796
Message ID:
00794396
Views:
22
Gregory,

>I do not use recursion as this will only slow down the process

While it is true that recursion has some overhead because it has to place information on the stack, most of the time it bypasses the overhead needed in a flat stack solution to circumvent the recursive nature of the optimum solution.

If you look at the solutions I provided in Message #788088 and related to this problem Re: Mathematics knundrum Thread #780672 Message #788120 you'll see that the given solutions are not only the fastest, but also the shortest and IMO als the most readable ones.

I think the problem is that many developers have difficulty in identifying when recursive algorithms are your best bet, and that they are not perticular familiar with them.

Of course recursive algorithms have their disadvantage too as stack/language nestin limitations (in VFP 128 levels).

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform