I want to take the name and turn it into a integer value 1-22 since my HashMap is size of 22.
Something like this but I know it does't work...
int value = (int)name % 22;
Type: Posts; User: jocdrew21
I want to take the name and turn it into a integer value 1-22 since my HashMap is size of 22.
Something like this but I know it does't work...
int value = (int)name % 22;
I think this answered my question. Fired at the hip at this one.
//play with Hash Tables
void setNames(Node node)
{
HashMap<Node, Integer> map = new HashMap<Node, Integer>(22);
...
I was wondering if I was over looking something and there was a way to just simply send in a name and place it in a hashTable. Perhaps send in a Node and index it by a string value inside of it.
When learning HashMaps in C++ I had to create the whole algorithm. In the code I created I could simply place a string into the method and it would store the names for me by turning the string into a...