Question: Consider the problem of coding the letter game, Scrabble. Initially take a dictionary of ~100,000 words. For every word, split it up into the individual

Consider the problem of coding the letter game, Scrabble. Initially take a dictionary of ~100,000 words. For every word, split it up into the individual letters of the word. Sort the letters alphabetically. The sorted letters represent unique the letters of a particular word. Store these letters in a hash table with letters as keys, and the word is the stored value. Using this technique, the word TAR is the list of letters, [a, r, t], is hashed and the word tar is stored. Consider every other word stored at this hashed location. The words tart, art, and rat would be found here, also. This technique would allow a user to check all of the words that can be created with the available letters in their hand. Answer the following.

1) Describe a suitable hashing function for this technique. Give a detailed answer, but no actual code is required for this answer.

2) In your own words, discuss the time complexity of this technique. What are the upper and lower bounds? Best case and worst case?

3) Write pseudo code for the technique described above.

4) Last, code this approach in Python. Submit your scrabble.py source code.

5) Briefly describe another approach to this problem other than hashing.

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!