Question: JAVA PROGRAMMING Given a list of strings (a dictionary) implement the following two functions: 1. void setup(List words)//Preprocesses the dictionary to do fast lookups through

JAVA PROGRAMMING

Given a list of strings (a dictionary) implement the following two functions:

1. void setup(List words)//Preprocesses the dictionary to do fast lookups through isMatch

2. boolean isMatch(String word) //Returns true if the word exists in the dictionary, false otherwise.

Examples:

setup({"foo", "bar", "baz"})

isMatch("f.") -> false

isMatch("ba.") -> true

isMatch("foo") true

isMatch("f.o") true

Word given to isMatch can contain a wild card character "." which matches exactly one character.

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 Programming Questions!