This commit is contained in:
Tanguy MAZE
2019-06-22 18:23:35 +02:00
commit f9e508d5ef
173 changed files with 6727 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
Assignment name : cycle_detector
Expected files : cycle_detector.c
Allowed functions: malloc, free
--------------------------------------------------------------------------------
Create a function named cycle_detector that takes a const t_list *list
as argument, and check if the given linked list contains no cycles.
A cycle is defined when you go at least twice through the same link, when you
travel inside a linked list.
This function should returnw 1 if it detects a cycle inside the given linked
list, otherwise it returns 0.
This function should be prototyped like this:
int cycle_detector(const t_list *list)
The type t_list is:
typedef struct s_list
{
int data;
struct s_list *next;
} t_list;
This type will be included in a header named "list.h". You don't have to turn-in
your "list.h", we will use ours during the evaluation.

View File

@@ -0,0 +1,28 @@
Assignment name : cycle_detector
Expected files : cycle_detector.c
Allowed functions: malloc, free
--------------------------------------------------------------------------------
Créez une fonction cycle_detector qui prends un "const t_list *list" en
argument, qui vérifiera qu'il n'y a aucun cycle à l'intérieur de la liste chainée
list.
Un cycle est défini quand, lors du parcours de la liste, vous passez au moins 2
fois à travers le même maillon.
Cette fonction retournera 1 si la fonction détecte un cycle, sinon elle renverra 0.
Cette fonction sera prototypé comme suit :
int cycle_detector(const t_list *list)
Le type "t_list" est défini comme suit :
typedef struct s_list
{
int data;
struct s_list *next;
} t_list;
Ce type sera fourni dans le header "list.h". Vous n'avez pas besoin de le fournir,
nous utiliserons le notre en correction.