Skip to content

Latest commit

 

History

History

linked_list_cycle

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Write a function which, given a linked list, returns whether that linked list contains a cycle.

E.g., given the following linked list, your function will say "yes, this contains a cycle".

               E
            /  ^
          v    |
A -> B -> C -> D

That is, where traversing would result in C -> D -> E -> C -> D -> E