Hướng dẫn python recursion limit
View Discussion Improve Article Save Article View Discussion Improve Article Save Article When you execute a recursive function in Python on a large input ( > 10^4), you might encounter a “maximum recursion depth exceeded error”. This
is a common error when executing algorithms such as DFS, factorial, etc. on large inputs. This is also common in competitive programming on multiple platforms when you are trying to run a recursive algorithm on various test cases. Python3
Output : Using the setrecursionlimit() method, we can increase the recursion limit and the program can be executed without errors even on large inputs. Python3
Output : |