a. Implement the word puzzle program using the algorithm described at the endof the

Chapter 5, Problem 5.18

(choose chapter or problem)

a. Implement the word puzzle program using the algorithm described at the endof the chapter.b. We can get a big speed increase by storing, in addition to each word W, all ofWs prefixes. (If one of Ws prefixes is another word in the dictionary, it is storedas a real word.) Although this may seem to increase the size of the hash tabledrastically, it does not, because many words have the same prefixes. When a scanis performed in a particular direction, if the word that is looked up is not evenin the hash table as a prefix, then the scan in that direction can be terminatedearly. Use this idea to write an improved program to solve the word puzzle.c. If we are willing to sacrifice the sanctity of the hash table ADT, we can speed upthe program in part (b) by noting that if, for example, we have just computedthe hash function for excel, we do not need to compute the hash function forexcels from scratch. Adjust your hash function so that it can take advantage ofits previous calculation.d. In Chapter 2, we suggested using binary search. Incorporate the idea of usingprefixes into your binary search algorithm. The modification should be simple.Which algorithm is faster? class Map2 {3 public Map( )45 public void put( KeyType key, ValueType val )6 public ValueType get( KeyType key )7 public boolean isEmpty( )8 public void makeEmpty( )910 private QuadraticProbingHashTable> items;1112 private static class Entry13 {14 KeyType key;15 ValueType value;16 // Appropriate Constructors, etc.17 }18 }

Unfortunately, we don't have that question answered yet. But you can get it answered in just 5 hours by Logging in or Becoming a subscriber.

Becoming a subscriber
Or look for another answer

×

Login

Login or Sign up for access to all of our study tools and educational content!

Forgot password?
Register Now

×

Register

Sign up for access to all content on our site!

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back