Question: My question is too write a program in java thats takes an arrayList of (ALLY BETA COOL DEAL ELSE FLEW GOOD HOPE IBEX ) and

My question is too write a program in java thats takes anMy question is too write a program in java thats takes an arrayList of (ALLY BETA COOL DEAL ELSE FLEW GOOD HOPE IBEX ) and groups them as explained above into 5 group as shown above for letter 'e'. You must use regulaur expression to do this. I am stuck understanding how reg ex is used so please explain in answer.

Let's illustrate this technique with an example. Suppose that you are playing Hangman and it's your turn to choose a word, which we'll assume is of length four. Rather than committing to a secret word, you instead compile a list of every four-letter word in the English language. For simplicity, let's assume that English only has a few four-letter words all of which are reprinted here ALLY BETA COOL DEAL ELSE FLEW GOOD HOPE IBEX Now, suppose that your opponent guesses the letter 'E'. You now need to tell your opponent which letters in the word you've "picked" are E's. Of course, you haven't picked a word, and so you have multiple options about where you reveal the E's If you'll notice, every word in your word list falls into one of five "word families": . , which contains the word ALLY, COOL, and GOOD . -E, containing BETA and DEAI . -E, containing FLEW and IBEX o E--E, containing ELSE. . E, containing HOPE. Since the letters you reveal have to correspond to some word in your word list, you can choose to reveal any one of the above five families. There are many ways to pick which family to reveal - perhaps you want to steer your opponent toward a smaller family with more obscure words, or toward a larger family in the hopes of keeping your options open In this assignment, in the interests of simplicity, we'll adopt the latter approach and always choose the largest of the remaining word families. In this case, it means that you should pick the family ----. This reduces your word list down to ALLY COOL GOOD

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!