Skip to content

The last, deprecated recursive version

Latest
Compare
Choose a tag to compare
@junipertcy junipertcy released this 03 Mar 01:48
4d5f8ad

As of version 3.8, it is well-known that python treats tail recursion poorly and it by default has a low recursion depth. Although sys.setrecursionlimit(limit) seems to bypass this problem, at some larger inputs a segmentation fault is raised indefinitely.

There is no workaround. Therefore, the program will be written in later versions as an iterative form, rather than recursive.

Aside: related PEP's

  • PEP 651: Robust Stack Overflow Handling (created 18-Jan-2021)