Talk:Hofstadter Q sequence

From Rosetta Code
Revision as of 09:53, 28 October 2011 by rosettacode>AlexLehm (added recursion limit issue)

Python non-recursive solution

Thanks Ledrug. I had a brain freeze on removing the recursion and blundered on with the accommodation of the recursion limit solution. --Paddy3118 18:34, 23 October 2011 (UTC)

Recursion limit issue

As Ledrug pointed out wrt. to my Dart solution with cache, there is a problem when calling the function with a large number first (e.g. q(100000)) since the cache is filled recursively counting from n to 2 if it is empty (happens with the Java solution for example). This doesn't occur in the calculations necessary to solve the tasks since this way the cache is filled ascending. Maybe the task description should be changed whether it is required to accommodate this. --AlexLehm 09:53, 28 October 2011 (UTC)