Read all words from a file and add them to a map whose keys are the first

Question:

Read all words from a file and add them to a map whose keys are the first letters of the words and whose values are sets of words that start with that same letter. Then print out the word sets in alphabetical order.

Provide two versions of your solution, one that uses the merge method (see Special Topic 15.1) and one that updates the map as in Worked Example 15.1.

Data from special topic 15.1

image text in transcribed

Data from worked example 15.1.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: