Objective
Implement a function that decides whether a singly linked list eventually loops back onto itself or terminates with a NULL pointer.
Steps
$ detect_cycle(NULL)
0
$ detect_cycle(head) // list: A -> B -> C -> NULL
0
$ detect_cycle(head) // list: A -> B -> C -> D -> A (tail loops to head)
1
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Objective
Implement a function that decides whether a singly linked list eventually loops back onto itself or terminates with a NULL pointer.
Steps
$ detect_cycle(NULL)
0
$ detect_cycle(head) // list: A -> B -> C -> NULL
0
$ detect_cycle(head) // list: A -> B -> C -> D -> A (tail loops to head)
1
Expected files
Allowed functions
None. Write every helper yourself.
Allowed headers

Tests
Run the tests to grade your code