-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path13-main.c
More file actions
35 lines (30 loc) · 712 Bytes
/
13-main.c
File metadata and controls
35 lines (30 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
#include <stdlib.h>
#include "lists.h"
/**
* main - check the code for
*
* Return: Always 0.
*/
int main(void)
{
listint_t *head;
head = NULL;
add_nodeint_end(&head, 1);
add_nodeint_end(&head, 17);
add_nodeint_end(&head, 972);
add_nodeint_end(&head, 50);
add_nodeint_end(&head, 98);
add_nodeint_end(&head, 98);
add_nodeint_end(&head, 50);
add_nodeint_end(&head, 972);
add_nodeint_end(&head, 17);
add_nodeint_end(&head, 1);
print_listint(head);
if (is_palindrome(&head) == 1)
printf("Linked list is a palindrome\n");
else
printf("Linked list is not a palindrome\n");
free_listint(head);
return (0);
}