| 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)); |
| 13 | list_display_values(head); |
| 14 | head = list_prepend(head, 5); |
| 15 | printf("Longueur de la liste: %d\n", list_count(head)); |
| 16 | list_display_values(head); |
| 17 | list_set(head, 0, 78); |
| 18 | list_display_values(head); |
| 19 | head = list_insert(head, 2, 7); |
| 20 | list_display_values(head); |
| 21 | head = list_delete(head, 3); |
| 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); |
| 29 | list_clear(head); |
| 30 | |
| 31 | return 0; |
| 32 | } |