The data structure & algorithm class that I'm taking now is a lot of pen and paper understanding of how algorithms work, but very little actual coding. I'm kind of a programming noob, so this may be a stupid question to some of you.
Conceptually, I understand hashing, and the reasons for the different methods, but am lost on how to code this assignment.
Basically we can use any source code that we want. The codes from the book are http://users.cis.fiu.edu/~weiss/dsaajava3/code/SeparateChainingHashTable.java and http://users.cis.fiu.edu/~weiss/dsaajava3/code/QuadraticProbingHashTable.java
When using either of these codes, I seem to have trouble inserting the keys into the table. I'm using this block to insert:
Random randomGenerator = new Random();
int randomInt = randomGenerator.nextInt(99999);
for (int i = 0; i < 100; i++) {
H.insert(""+randomInt);
}
This doesn't seem to actually insert anything into the table, however, the size remains constant despite the amount of insertions. Also, I have no idea how to determine how many probes were needed.