Notifications
Clear all
[Closed] Getting the Parent Root of a hierarchy
Page 2 / 2
Prev
Jan 31, 2012 1:59 am
no doubt… i have tools where i use a recursive version of the function getRoot. why? because in the same tool i have another recursive functions which can’t be done without recursion. so what’s the difference? one function more, one less…
Jan 31, 2012 1:59 am
…and classic optimization problem is the removal of ‘tail recursion’.
You don’t need to maintain a stack of prior calling states if all you do is immediately return the results of the last recursive call that was made.
Page 2 / 2
Prev