ArchiSys/TP/TP1/rendu/linked_list.h

19 lines
483 B
C
Raw Normal View History

2024-03-26 17:06:15 +01:00
#include <stdbool.h>
struct node {
2024-03-26 17:45:20 +01:00
void *data;
int key;
struct node *next;
2024-03-26 17:06:15 +01:00
};
struct linkedList {
2024-03-26 17:45:20 +01:00
struct node *head;
};
2024-03-26 17:06:15 +01:00
struct linkedList* createLinkedList();
void insertFirst(struct linkedList *list, int key, void *data);
struct node* deleteFirst(struct linkedList *list);
struct node* find(struct linkedList *list, int key);
struct node* deleteElement(struct linkedList *list, int key);
bool isEmpty(struct linkedList *list);
int length(struct linkedList *list);