Page 1 of 1

Structures

Posted: Sun Apr 28, 2019 11:20 pm
by rashmigodbole
Which data structures are applied when dealing with a recursive function?

Re: Structures

Posted: Sat May 04, 2019 9:34 am
by jwax
Welcome, rash-
That's a common question, on everybody's mind lately.
If yours is regarding the blivit data structure, you'll find the inverse logarithmic recursive function applies, while the data structure of the n-th dimension requires compliance with asymmetrical contrasting cardinal grammeters.

Re: Structures

Posted: Sat May 04, 2019 11:58 am
by JeremyLeach
A wild guess is that you're referring to microcontrollers. In general the programming language has a concept of a 'stack', and local variables used within functions are saved to the stack every time the recursive function calls itself. So because memory is precious on microcontrollers compared to PCs then you have to tread carefully with recursion, because the stack can get full very quickly.

But then again you might not have meant this at all :grin:

Re: Structures

Posted: Mon May 06, 2019 12:51 pm
by haklesup
Well the question is without context or detail. A recursive function is one that uses the result from one solution as the input to the next calculation and solution. Assuming this is programming code based question (and not a paper calc) The function should have a counter to define the number of recursions and at least one variable derived from the output variable of the same function. There are probably many ways to implement this in code depending on the language. A large set probably needs an array with pointer and stack offsets. I'm not a coder and this question better fits in a programming forum I think

Something like IF counter <= max value
THEN Calculate result A=A(index)+B(counter) (B is an array value)
A= Array value (index)
Return to top