Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recursivity
Message
From
06/09/1997 12:47:36
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Miscellaneous
Thread ID:
00048680
Message ID:
00048826
Views:
55
>>>>hello, there is a way to write a recursive procedure in FoxPro 2.6 ?
>>>>actually there is the limit of 32 nested DO, but i need a limit of 200.
>>>>Someone could help me ?
>>>Roberto,
>>>
>>>Yes there is a limit of 32 calling levels in Fox 2.6 and this is not able to be changed. However 32 levels of recursive routine can be used to trnasgress a directory tree that is 2^32 levels deep when coded correctly. That is 4,294,927,296 levles of dirs or bom explosion. Probably could handle the Bill of materials explosion for the space shuttle.
>>>
>>>Why do you need 200 levels of recursion? That gives 2^200 levels of stuff which is a number that I can't even imagine the size of.
>>
>>Can you be more specific, please? I don't see the relation between the number of recursion levels n and 2^n.
>>
>>Vlad
>Vlad,
>
>Sure, in theory each recursive level can make calls to the next level multiple times sequentially without eating calling levels because the previous down level call returns before the next down level call is issued. This renders 2 levels to the caller - callee relationship. Now we have 32 levels of caller to calle possibilities, therefore 2 (the caller-callee relation) ^ 32(the number of caller-callee relations allowed) possible levels of recursion.

Hope I understood it right: You talk about recursion on a complete binary tree with 33 levels (or 32 levels that are not the root). It's true that in such a tree you'll have 2^32 leaves (terminal nodes) and that you can process all 2^32 leaves with only 32 levels of recursion (maximum calling sequence). But that doesn't mean you can have 2^32 levels of recursion.

Also, I don't see how you can apply/generalize this to a non-binary tree. How do you process a directory tree with 100 levels of subdirectories (you said you can transgress a directory tree with up to 2^32 levels.) (Or, maybe we use the word "level" for different things?)

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform