changment dans basic.c et dans double.c
Tests TP prog-104-p-02-2030 / test (push) Failing after 8s

This commit is contained in:
2026-04-03 16:54:34 +02:00
parent 72a13f7a19
commit 40d224a8f8
2 changed files with 12 additions and 3 deletions
@@ -20,13 +20,19 @@ struct dlist *dlist_append(struct dlist *l, int e)
int dlist_insert(struct dlist **l, size_t index, int e)
{
struct dlist *tmp = *l;
if(!l) return 1;
struct dlist *new_node = malloc(sizeof(struct dlist));
if(!new_node) return 1;
//struct dlist *tmp = *l;
if(index == 0){
dlist_append(*l, e);
return 0;
}
struct dlist *tmp = *l;
size_t ind = 0;
while(tmp != NULL && ind < index - 1){
@@ -36,8 +42,8 @@ int dlist_insert(struct dlist **l, size_t index, int e)
if(!tmp) return 1;
struct dlist *new_node = malloc(sizeof(struct dlist));
if(!new_node) return 1;
//struct dlist *new_node = malloc(sizeof(struct dlist));
//if(!new_node) return 1;
new_node->data = e;
new_node->next = tmp;