Ajoute un court paquet de listes chaînées
This commit is contained in:
18
linked-list/src/linkedList.c
Normal file
18
linked-list/src/linkedList.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "linkedList.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
LinkedList createLinkedList(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void freeLinkedList(LinkedList *list) {
|
||||
struct list_node *next;
|
||||
struct list_node *node = *list;
|
||||
while (node != NULL) {
|
||||
next = node->next;
|
||||
free(node);
|
||||
node = next;
|
||||
}
|
||||
*list = NULL;
|
||||
}
|
Reference in New Issue
Block a user