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