Cycle detection: Difference between revisions

m
→‎Functional Python: (added a works with tag)
(→‎Functional Python: Added a scalable (non recursive) version, updated tests and output for lists of 10000+ items)
m (→‎Functional Python: (added a works with tag))
Line 1,628:
and now it all works again, with the structure conserved but recursion removed.
The Python no longer falls out of the tree at the sight of an ouroboros, and we can happily search for cycles in lists of several thousand items:
{{Works with|Python|3.7}}
<lang python>'''Cycle detection'''
 
9,655

edits