Reputation: 295
I'm confused why this doesn't work. It's suppose to set all the table[count] to null but it wont let me.
public HashTable(int sz) {
// Count to initalize all to null
int counter = 0;
// Initalizes the global size to the
// sz passed in
size = sz;
// Initalizes
table = new Base[size];
probeCount = new int[size];
// Initalizes all to null
while (counter <= probeCount) {
table[count] = null;
counter++;
}
}
Upvotes: 0
Views: 149
Reputation: 1568
This is probably what you want to do. You're comparing two different things. You want to compare the size
// Initalizes all to null
while (counter <= size)/ {
table[count] = null;
counter++;
}
Upvotes: 2