+1(805) 568 7317

write a c program in linux that will read two input files identify common words that 5252859

Write a C program in Linux that will read two input files, identify common words that appear in both files, and

write them into an output file in sorted order along with their total number of occurrences in both files. For

each input file, your program will build a separate linked list where each node of the list will contain a unique

word that exists in that file and the number of occurrences of that word (hereafter referred to as count) within

that file. Hence, each node of the linked list will be a struct having fields to store the word itself (char *)

and its count (int). You will build the list as a doubly linked list, where each node in the list has a pointer to

the next node and the previous node. After building these two input lists, your program will find the common

words in both lists, find their total count, and create a third output list that will be used for printing the result

into the output file in ascending sorted order. Sorting will be done based on the word field. For comparison of

the words, you will use the strcmp() function. You must implement and use the insertion sort algorithm

to sort the two input lists. Each line of the output file will contain information about a word occurring in both

input files in the following format:


Note the comma (instead of space or TAB characters) between the fields. The output should not contain

any spaces, TABs, or empty lines. So, after you write the last line of information, you should close the file,

and this should be the end of your program. It is very important that you produce the output in this rigid

format since we will use this format in our automated black-box tests. Words in input files are separated by

whitespace characters, which can either be a , a , or a character.

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon

Order Now