/* Drier program to test above functions*/ int main() { /* Start with the empty list */ struct node* head = NULL; /* Let us create a sample linked list as following 0->2->4->6->8->10->11 */ push(&head, 11); push(&head, 10); push(&head, 8); push(&head, 6); push(&head, 4); push(&head, 2); push(&head, 0); push(&head,3); printf("\n Original Linked list "); printList(head); segregateEvenOdd(&head); printf("\n Modified Linked list "); printList(head); return 0; }
/* Drier program to test above functions*/ int main() { /* Start with the empty list */ struct node* head = NULL; struct node* even = NULL; struct node* odd = NULL; /* Let us create a sample linked list as following 0->2->4->6->8->10->11 */ push(&head, 6); push(&head, 5); push(&head, 4); push(&head, 3); push(&head, 2); push(&head, 1); push(&head, 9); printf("\nOriginal Linked list \n"); printList(head); segregateEvenOdd(&head, &even, &odd); printf("\nModified Linked lists \n"); printList(even); printf("\n"); printList(odd); return 0; }