jova wrote:
What are some of the benefits of using a hash table data structure?
I found hashtables to be very useful when needing to sort through a
large set of classes. Each class has a name property, when i add a class
to the hashtable i do something like:
Hashtable table = new Hashtable();
Human newHuman = new Human();
newHuman.setName("Carl");
table.put(newHuman.getName(),newHuman);
thus, i can sort the hashtable by each Human's name.
anyway, once the hashtable is populated, i can easily search the table
with the containsKey() method, to see if a Human is in this table.
That's all i normally use it for, massive class searching by name.