Update detect_cycle.py

This commit is contained in:
marina 2023-08-02 16:40:19 -07:00 committed by GitHub
parent 4e82aa6060
commit 67656b197d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,12 @@
# -*- coding: utf-8 -*-
# author: bt3gl
class tNode:
def __init__(self, val):
self.val = val
self.next = None
def has_cycle(self, head) -> bool: