Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do Factorials in VFP with Recursion
Message
From
27/02/2000 00:28:12
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00335196
Message ID:
00338136
Views:
18
>As for performance, I can;t agree with what you siad. I ahve seen many times that a recursive solution is the fastest one. This is only true, though, when the problem is recursive in nature.

Ok. In this case, I will say it in a different way: I am very sure that whatever recursive solution you have,
for whatever problem, I can write a faster non-recursive solution. This doesn't mean the performance gain would
justify the non-recursive solution and it doesn't mean it would be better and it doesn't mean I would use it in
real programming. It means only that there is a faster non-recursive solution (even if the gain would be <1%...).

>For example traversing a directory tree. The problem is recursive, I must find all the enteries in a directory, and if one of those is a directory I must find all the enteries for that directory, and on and on.

This is a very good example for what I've said above. I agree that this is a recursive problem and most probably the
performance gain for the non-recursive solution would not justify the additional complexity.

>Recursive problem, recursive solution. Iterative problem, irterative solution.

Right!

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform