"ulimit -s" has no effect?
Maciej Kalisiak
mac at dgp.toronto.edu
Fri Feb 6 22:42:04 EST 2004
Josiah Carlson <jcarlson at nospam.uci.edu> writes:
> > def foo(i):
> > print i foo(i+1)
> > import sys
> > sys.setrecursionlimit(1000000)
> > foo(0)
>
> This entire thread begs the question: Why are you recursing this deep?
> It would be faster to iterate.
The algorithm calls for it: Tarjan's algorithm for finding the
Strongly-Connected Component (SCC) of a graph. If there is an equally
efficient iterative approach, I'd like to hear of it.
I don't think I need to recurse to depth 1,000,000 , but definitely higher
than 7k.
More information about the Python-list
mailing list