Write a function called is_equivalent
which will check if two circular linked list are equivalents (containing the same values)
As circular linked list doesn't have a start nor an end, the function will take as parameter a node of the linked list.
To represent a circular linked list, use the following structure:
typedef struct node { struct node *next; int value; } node_t;
An exemple of a circular linked list is given below:
And here's an exemple of use of the function:
noeud first (pointer to node containg 1) : 1->3->4->5->first node (1) noeud second (pointer to node containg 5) : 5->1->3->4->first node (5) is_equivalent(first, second, 4) returns 1 (They are the same linked list)