As we all know, if you have a function like this: def foo(): foo() The function will call itself 1000 times and then you get a RecursionError exception. But what if you had a thousand and one different functions that call each other? i.e. a() calls b() calls c() and so on. Would you get… Read More Are there separate call tree depths for recursive and non-recursive calls?
I was wondering if someone could help me rewrite this code as non-recursive so it can compute higher numbers, my current code looks like this: def T(n): if n < 3: return n return T(n – 1) + 2 * T(n – 2) – T(n – 3) The function is designed for the purpose of… Read More Writing a non-recursive function as maximum recursion depth has been exceeded