|
| 1 | +#include <stdlib.h> |
| 2 | +#include <string.h> |
| 3 | +#include <stdio.h> |
| 4 | +#include "lists.h" |
| 5 | + |
| 6 | +/** |
| 7 | + * main - check the code |
| 8 | + * |
| 9 | + * Return: Always EXIT_SUCCESS. |
| 10 | + */ |
| 11 | +int main(void) |
| 12 | +{ |
| 13 | + dlistint_t *head; |
| 14 | + |
| 15 | + head = NULL; |
| 16 | + add_dnodeint_end(&head, 0); |
| 17 | + add_dnodeint_end(&head, 1); |
| 18 | + add_dnodeint_end(&head, 2); |
| 19 | + add_dnodeint_end(&head, 3); |
| 20 | + add_dnodeint_end(&head, 4); |
| 21 | + add_dnodeint_end(&head, 98); |
| 22 | + add_dnodeint_end(&head, 402); |
| 23 | + add_dnodeint_end(&head, 1024); |
| 24 | + print_dlistint(head); |
| 25 | + printf("-----------------\n"); |
| 26 | + delete_dnodeint_at_index(&head, 5); |
| 27 | + print_dlistint(head); |
| 28 | + printf("-----------------\n"); |
| 29 | + delete_dnodeint_at_index(&head, 0); |
| 30 | + print_dlistint(head); |
| 31 | + printf("-----------------\n"); |
| 32 | + delete_dnodeint_at_index(&head, 0); |
| 33 | + print_dlistint(head); |
| 34 | + printf("-----------------\n"); |
| 35 | + delete_dnodeint_at_index(&head, 0); |
| 36 | + print_dlistint(head); |
| 37 | + printf("-----------------\n"); |
| 38 | + delete_dnodeint_at_index(&head, 0); |
| 39 | + print_dlistint(head); |
| 40 | + printf("-----------------\n"); |
| 41 | + delete_dnodeint_at_index(&head, 0); |
| 42 | + print_dlistint(head); |
| 43 | + printf("-----------------\n"); |
| 44 | + delete_dnodeint_at_index(&head, 0); |
| 45 | + print_dlistint(head); |
| 46 | + printf("-----------------\n"); |
| 47 | + delete_dnodeint_at_index(&head, 0); |
| 48 | + printf("-----------------\n"); |
| 49 | + delete_dnodeint_at_index(&head, 0); |
| 50 | + printf("-----------------\n"); |
| 51 | + delete_dnodeint_at_index(&head, 0); |
| 52 | + printf("-----------------\n"); |
| 53 | + delete_dnodeint_at_index(&head, 0); |
| 54 | + printf("-----------------\n"); |
| 55 | + delete_dnodeint_at_index(&head, 0); |
| 56 | + printf("-----------------\n"); |
| 57 | + delete_dnodeint_at_index(&head, 0); |
| 58 | + printf("-----------------\n"); |
| 59 | + delete_dnodeint_at_index(&head, 0); |
| 60 | + printf("-----------------\n"); |
| 61 | + delete_dnodeint_at_index(&head, 0); |
| 62 | + printf("-----------------\n"); |
| 63 | + delete_dnodeint_at_index(&head, 0); |
| 64 | + printf("-----------------\n"); |
| 65 | + delete_dnodeint_at_index(&head, 0); |
| 66 | + print_dlistint(head); |
| 67 | + return (0); |
| 68 | +} |
0 commit comments