Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mathematical Challenge (Lottery)
Message
 
 
To
30/05/2003 12:27:24
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00785796
Message ID:
00794627
Views:
23
Hi Walter,

I believe, I heard an 'acsiom' (? spell), that every recursive algorithm has a non-recursive equavelent. Non-recursive is supposed to be faster...

>Gregory,
>
>>I haven't compared the two. (have you ?)
>>
>>It is a modification of a piece of code I use, which transforms
>>
>>for i1 = .. to ..
>>  for i2 = .. to ..
>>    for ... = .. to ..
>>     ...
>>      for iN = ... to ...
>>
>>where # of i is not known at the start and is related to the # of items to combine, into a general loop using i[..]
>
>I think they´re not comparable because the way you describe above your program is static if you change the number of levels you´ve got to change the program. Though it is manageble as we can compile on the fly it is not a prefferable way.
>
>Further I did not find any working example this way that did the same thing except for george example. The recursive one was about 10 times as fast.
>
>>I use recursion when I can. It's just that the # of levels is not known at the start and vfp has a sort-of low limit whereas in C I would have used recursion
>
>For the problems described in the two threads the number of levels will not reach the maximum of 128 levels and thus will not be a problem at all.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform