Skip to content

Files

Latest commit

faf57d9 · Mar 7, 2015

History

History

linked_list_cycle

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 7, 2015
Mar 3, 2015

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