Structures

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
rashmigodbole

Structures

Post by rashmigodbole » Sun Apr 28, 2019 11:20 pm

Which data structures are applied when dealing with a recursive function?

User avatar
jwax
Posts: 2151
Joined: Mon Feb 09, 2004 1:01 am
Location: NY
Contact:

Re: Structures

Post by jwax » Sat May 04, 2019 9:34 am

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.

JeremyLeach
Posts: 1
Joined: Sat May 04, 2019 11:48 am
Contact:

Re: Structures

Post by JeremyLeach » Sat May 04, 2019 11:58 am

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:

User avatar
haklesup
Posts: 2948
Joined: Thu Aug 01, 2002 1:01 am
Location: San Jose CA
Contact:

Re: Structures

Post by haklesup » Mon May 06, 2019 12:51 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests