
Implement a function that decides whether a singly linked list eventually loops back onto itself or terminates with a NULL pointer.
detect_cycle(NULL)0detect_cycle(head) // list: A -> B -> C -> NULL0detect_cycle(head) // list: A -> B -> C -> D -> A (tail loops to head)1detect_cycle.c<stddef.h>defines NULL
Run the tests to grade your code
Implement a function that decides whether a singly linked list eventually loops back onto itself or terminates with a NULL pointer.
detect_cycle(NULL)0detect_cycle(head) // list: A -> B -> C -> NULL0detect_cycle(head) // list: A -> B -> C -> D -> A (tail loops to head)1detect_cycle.c<stddef.h>defines NULL
Run the tests to grade your code
Memory will appear here