mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-03 07:15:04 -04:00
Update detect_cycle.py
This commit is contained in:
parent
4e82aa6060
commit
67656b197d
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,12 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# author: bt3gl
|
# author: bt3gl
|
||||||
|
|
||||||
|
class tNode:
|
||||||
|
|
||||||
|
def __init__(self, val):
|
||||||
|
self.val = val
|
||||||
|
self.next = None
|
||||||
|
|
||||||
|
|
||||||
def has_cycle(self, head) -> bool:
|
def has_cycle(self, head) -> bool:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue