Commit | Line | Data |
---|---|---|
f8051b35 JB |
1 | #include <stdio.h> |
2 | ||
3 | #include "clist.h" | |
4 | ||
5 | int main() { | |
6 | link_t* head = NULL; | |
7 | printf("Longueur de la liste: %d\n", list_count(head)); | |
8 | head = list_append(head, 1); | |
9 | head = list_append(head, 2); | |
10 | head = list_append(head, 3); | |
11 | head = list_append(head, 4); | |
12 | printf("Longueur de la liste: %d\n", list_count(head)); | |
83ec54cd | 13 | list_display_values(head); |
f8051b35 JB |
14 | head = list_prepend(head, 5); |
15 | printf("Longueur de la liste: %d\n", list_count(head)); | |
83ec54cd | 16 | list_display_values(head); |
f8051b35 | 17 | list_set(head, 0, 78); |
83ec54cd | 18 | list_display_values(head); |
3de00528 | 19 | head = list_insert(head, 2, 7); |
83ec54cd | 20 | list_display_values(head); |
3de00528 | 21 | head = list_delete(head, 3); |
83ec54cd JB |
22 | list_display_values(head); |
23 | head = list_append(head, 5); | |
24 | head = list_append(head, 12); | |
25 | head = list_append(head, 65); | |
26 | head = list_append(head, 21); | |
27 | head = list_sort(head); | |
28 | list_display_values(head); | |
f8051b35 JB |
29 | list_clear(head); |
30 | ||
31 | return 0; | |
32 | } |