#include #include #include #define MAX_STR_LEN 80 //decalring the structure struct link_node { //declaring the variables char node_str[ MAX_STR_LEN ]; struct link_node *next; }; //method declaration typedef struct link_node link_node; struct link_node *add_node( struct link_node *list,struct link_node *node ); int compare_node( struct link_node *n1, struct link_node *n2 ); void display_list( struct link_node *head ); //implementing the method main int main() { //declaring the main variables link_node * head=NULL,*temp; char str[MAX_STR_LEN]; do { //getting the STRING input printf(\"Enter the string : \"); gets(str); //malloc() is implemented for memory temp=(link_node*)malloc(sizeof(link_node)); temp->next=NULL; strcpy(temp->node_str,str); head=add_node(head,temp); }while(strlen(str)>1); display_list(head); return 0; } //method definition for compare node int compare_node( struct link_node *n1, struct link_node *n2 ) { if(strcmp(n1->node_str,n2->node_str)==0) return 0; if(strcmp(n1->node_str,n2->node_str)<0) return -1; else return 1; } //method definition for adding the node struct link_node *add_node( struct link_node *list,struct link_node *node ) { link_node *temp=list; if(list==NULL) { return node; } if(compare_node(node,list)==-1) { node->next=list; list=node; return list; } else { link_node *prev=list; while(temp!=NULL&&compare_node(node,temp)>=0) { prev=temp; temp=temp->next; } prev->next=node; node->next=temp; return list; } } //method definition for displaying the list void display_list( struct link_node *head ) { link_node *temp; while(head) { printf(\"%s\ \",head->node_str); temp=head; head=head->next; free(temp); } } Sample output: Enter the string: Geneva America Solution #include #include #include #define MAX_STR_LEN 80 //decalring the structure struct link_node { //declaring the variables char node_str[ MAX_STR_LEN ]; struct link_node *next; }; //method declaration typedef struct link_node link_node; struct link_node *add_node( struct link_node *list,struct link_node *node ); int compare_node( struct link_node *n1, struct link_node *n2 ); void display_list( struct link_node *head ); //implementing the method main int main() { //declaring the main variables link_node * head=NULL,*temp; char str[MAX_STR_LEN]; do { //getting the STRING input printf(\"Enter the string : \"); gets(str); //malloc() is implemented for memory temp=(link_node*)malloc(sizeof(link_node)); temp->next=NULL; strcpy(temp->node_str,str); head=add_node(head,temp); }while(strlen(str)>1); display_list(head); return 0; } //method definition for compare node int compare_node( struct link_node *n1, struct link_node *n2 ) { if(strcmp(n1->node_str,n2->node_str)==0) return 0; if(strcmp(n1->node_str,n2->node_str)<0) return -1; else return 1; } //method definition for adding the node struct link_node *add_node( struct link_node *list,struct link_node *node ) { link_node *temp=list; if(list==NULL) { return node; } if(compare_node(node,list)==-1) { node->next=list; list=no.