Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Argument starter - The roots of all evil
Message
 
To
16/09/2004 09:10:51
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00938079
Message ID:
00943757
Views:
29
>>One thing of note, however. A non-recurisve solution usually is faster (not that it matters much). This is because you don't have the push-pop mechanism going on all the time.
>
>But then, you have other things you had to code to replace recursion, so I figure these should make up for some of the difference in speed. These would probably be lighter things, like a few more variables and a do-while loop, and I expect the end result would be what you said - recursive solution's speed dropping with the number of iterations, or being just constantly slower because of the overhead.
>
>The big argument against recursion would be the case when you have to pass large arrays, heavy objects or lots of parameters to a recursing function. It's going to curse and re-curse at you for that :).

Dragan,

LOL!

BTW, I had a dark one for you last weekend at the Fox and Parrot Pub in Gatlinburg, TN.

To add to what I said to Walter, some problems actually cannot be efficiently solved without recursion. For example, search a directory tree. I think that any non-recursive search would require that you know the depth of the tree and the folders within it.

In this case, a non-recursive function is going to require maintainence if the files or folders change and if the tree grows beyond the original limits.

By using a recursive search, very little, if anything, would have to be done to accomidate such a change.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform