ArchiSys/TP/TP1/rendu/linked_list.h

19 lines
438 B
C
Raw Normal View History

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