Question: Write a program that simulates a translation dictionary. Your program must be able to support any number of words and multiple languages. All translations should

Write a program that simulates a translation dictionary. Your program must be able to support any number of words and multiple languages. All translations should be done as efficiently as possible, and it must be able to translate between any two languages. Your code should not care what languages exist in the dictionary it should be possible to add more languages by changing the code in init(), and not touching the code in translateWord(). Indicate the time complexity of your algorithm. Hint: You may want to use a map of maps. public class Dictionary { public void init() { // Create your data structure, and add some words } public String translateWord(String word, String srcLanguage, String destLanguage) { // Translate the word } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!