| 1 | #include <stdio.h> |
| 2 | |
| 3 | #include "clist.h" |
| 4 | |
| 5 | int main() { |
| 6 | link_t* head1 = NULL; |
| 7 | link_t* head2 = NULL; |
| 8 | link_t* head = NULL; |
| 9 | |
| 10 | printf("Longueur de la liste: %d\n", list_count(head1)); |
| 11 | head1 = list_append(head1, 1); |
| 12 | head1 = list_append(head1, 2); |
| 13 | head1 = list_append(head1, 3); |
| 14 | head1 = list_append(head1, 4); |
| 15 | printf("Longueur de la liste: %d\n", list_count(head1)); |
| 16 | list_display_values(head1); |
| 17 | head1 = list_prepend(head1, 5); |
| 18 | printf("Longueur de la liste: %d\n", list_count(head1)); |
| 19 | list_display_values(head1); |
| 20 | list_set(head1, 0, 78); |
| 21 | list_display_values(head1); |
| 22 | head1 = list_insert(head1, 2, 7); |
| 23 | list_display_values(head1); |
| 24 | head1 = list_delete(head1, 3); |
| 25 | list_display_values(head1); |
| 26 | head1 = list_append(head1, 5); |
| 27 | head1 = list_append(head1, 12); |
| 28 | head1 = list_append(head1, 65); |
| 29 | head1 = list_append(head1, 21); |
| 30 | head1 = list_sort(head1); |
| 31 | list_display_values(head1); |
| 32 | head2 = list_insert(head2, 0, 8); |
| 33 | head2 = list_append(head2, 6); |
| 34 | head2 = list_prepend(head2, 5); |
| 35 | list_display_values(head2); |
| 36 | head = list_concat(head1, head2); |
| 37 | list_display_values(head); |
| 38 | head = list_merge_sort(head); |
| 39 | //head = list_sort(head); |
| 40 | list_display_values(head); |
| 41 | //list_clear(head1); |
| 42 | //list_clear(head2); |
| 43 | list_clear(head); |
| 44 | |
| 45 | return 0; |
| 46 | } |