Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

how do i search for a number/word in a hash table?

OpenStudy (anonymous):

Hashtables work with generics. They map one object to another using hashing. The first object you give it is the Key, and the second is the value. HashTable<Key,Value> So, for example: myHashTable = new HashTable<String, Int>. To retrieve a particular int, you would have to give it the string that you stored it with in the first place. I would add some values like this, myHashTable.push("Apples",5); myHashTable.push("pumkinfr00ts",9001); myHashTable.push("Banarnars",25); If I wanted to get an object out, I treat it like an array. int myInt = myHashTable[pumpkinFr00ts];

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!