Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Recursion: 4 ways to get it working
#5
(02-14-2023, 09:13 PM)Dimster Wrote: My apologies Tempodi - it's not DEPTH I meant but STACKed. Iteration is depth to me as to how many wooden dolls can be fit into one another. That's what depth is to me. But recursion can't do that, recursion can be stacked on recursion call on top of another. My question is, is there one Recursion type you have demonstrated better than another for Stacking?

Hi Dimster
as already SMcNeill said :" It is the amount of available RAM to define how many recursion is possible to do until we get Overflow.
Going to analyze the different methods of recursion...

1. recursive calling a SUB with parameter as flag  

2. recursive calling a SUB with Global Shared variable as flag or a Shared variable between main and SUB recursive

3. recursive calling a SUB with STATIC option to preserve local variable as flag or a STATIC group of variables

we must answer to these questions to be able to answer to your is there one Recursion type you have demonstrated better than another for Stacking?

Is there a difference in speed of access to the variable if it is a parameter of SUB or a Global Shared variable or a SHARED variable or  a STATIC variable?
Is there a difference in amount of RAM used using these different methods? Otherwise a parameter vs global shared vs shared vs STATIC local variable does use different quantity of RAM?
Well, I think that these features depend on the architecture of compiler/interpreter and how it works with stack. 
In this point of view , for QB64pe the answer can arrive from developers of QB64pe.
Reply


Messages In This Thread
RE: Recursion: 4 ways to get it working - by TempodiBasic - 02-14-2023, 10:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  plotting shapes not working madscijr 6 654 10-22-2025, 05:29 AM
Last Post: SMcNeill
  why isn't _FULLSCREEN working? madscijr 5 532 09-20-2025, 01:47 AM
Last Post: SMcNeill
  I'm working on an old MS-DOS thingy... KlamPs 2 518 08-25-2025, 09:43 AM
Last Post: hsiangch_ong
  blue circle isn't drawing and print isn't working? madscijr 12 2,346 09-21-2024, 06:13 PM
Last Post: madscijr
  Updating Clock at a different rate to program loop-example not working as expected? dowster 1 616 08-15-2024, 12:06 PM
Last Post: luke

Forum Jump:


Users browsing this thread: 1 Guest(s)