CSC241: Homework 7


Substitute the LinkedList objects in your project with HashMap objects. Be careful to remove (or comment out) all code that is irrelevant (such as the quicksort / binary search code to find a Creature with a certain name). Would it have been easier to just start with HashMaps?

Note: hash tables (which HashMap is an instance of) are special-purpose dynamic structures. Be careful when substituting - a LinkedList or an array might actually be a better choice in certain places. If you have followed my directions well, however, a HashMap should be the obvious choice in two places: the data structure that every Room contains to hold its Creatures, and the data structure in the main method used to keep track of the Rooms in the input file. If you have used data structures in other places, make your own choice on whether to use HashMaps there as well. (hint: I would not need to use other data structures than the two mentioned above)