Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

construct a cross-reference index for a given text file. Such index structures h

ID: 647182 • Letter: C

Question

construct a cross-reference index for a given text file. Such index structures have applications in the design of compilers and databases.

Our task is to write a program that while reading a text file collects all words of the text and retains the numbers of the lines in which each word occurred. When this scan is terminated, a table is printed showing all collected words in alphabetical order with lists of line numbers where they occurred. There would be only one line for each word.

Represent the words encountered in the text by a binary search tree (also called a lex- icographic tree). For example, if there were three words

Explanation / Answer

Ans:- As you have not specifed in which language you want the answer I am providing the solution in java please go through the program and you are free to make changes as per your requirment

The answer is provided on the bases of my knowledge and information on the subject hope you had understood.

Thanks.