Program to merge two linked list, restricting commomn elements to occur only once
#include #include #include /* structure containing a data part and link part */ struct node { int data ; struct node *link ; } ; void add ( struct node **, int ) ; void display ( struct node * ) ; int count ( struct node * ) ; void merge ( struct node *, struct node *, struct node ** ) ; void main( ) { struct node *first, *second, *third ; first = second = third = NULL ; /* empty linked lists */ add ( &first, 9 ) ; add ( &first, 12 ) ; add ( &first, 14 ) ; add ( &first, 17 ) ; add ( &first, 35 ) ; add ( &first, 61 ) ; add ( &first, 79 ) ; clrscr( ) ; printf ( "First linked list : " ) ; display ( first ) ; printf ( "\nNo. of elements in Linked List : %d" , count ( first ) ) ; add ( &second, 12 ) ; add ( &second, 17 ) ; add ( &second, 24 ) ; add ( &second, 36 ) ; add ( &second, 59 ) ; add ( &second, 64 ) ; add ( &second, 87 ) ; printf ( "\n\nSecond linked list : " ) ; display ( ...