Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mathematical Challenge (Lottery)
Message
De
30/05/2003 04:57:35
Walter Meester
HoogkarspelPays-Bas
 
 
À
15/05/2003 06:46:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00785796
Message ID:
00794396
Vues:
21
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,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform