Each unit in a Latin textbook contains a Latin-English vocabulary of words that have been used for the first time in a particular unit. Write a program that converts a set of such vocabularies stored in file Latin into a set of English-Latin vocabularies. Make the following assumptions:
a. Unit names are preceded by a percentage symbol.
b. There is only one entry per line.
c. A Latin word is separated by a colon from its English equivalent(s); if there is more than one equivalent, they are separated by a comma.
To output English words in alphabetical order, create a binary search tree for each unit containing English words and linked lists of Latin equivalents. Make sure that there is only one node for each English word in the tree. For example, there is only one node for and, although and is used twice in unit 6: with words ac and atque. After the task has been completed for a given unit (that is, the content of the tree has been stored in an output file), delete the tree along with all linked lists from computer memory before creating a tree for the next unit.
Here is an example of a file containing Latin-English vocabularies:
%Unit 5ante : before, in front of, previouslyantiquus : ancientardeo : burn, be on fire, desirearma : arms, weaponsaurum : goldaureus : golden, of gold
%Unit 6animal : animalAthenae : Athensatque : andac : andaurora : dawn
%Unit 7amo : loveamor : loveannus : yearAsia : Asia
From these units, the program should generate the following output:
%Unit 5ancient : antiquusarms : armabe on fire : ardeobefore : anteburn : ardeodesire : ardeogold: aurumgolden : aureusin front of : anteof gold : aureuspreviously : anteweapons : arma
%Unit 6Athens : Athenaeand : ac, atqueanimal : animaldawn : aurora
%Unit 7Asia : Asialove : amor, amoyear : annus
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.