Hey,People I am trying construct methods.To perform linear probing.
I know how to read integers from files.But I struggling with how I can add them to the array in the right place
I have these methods
Hashfunction hashes by a prime
addToHash will add the read in number in the right place.
I know how to read integers from files.But I struggling with how I can add them to the array in the right place
I have these methods
Hashfunction hashes by a prime
addToHash will add the read in number in the right place.
public int hashfunction(int key) {
return key % hSize;
}
// Add to hash
private void addToHash(int value) {
}
// Read in values
public void readIntoHash(String file) {
try {
/** Set up file for reading **/
FileReader reader = new FileReader(file);
Scanner in = new Scanner(reader);
} catch (IOException e) {
System.out.println("Error processing file " + file);
}