Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Hashing using an array

$
0
0
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.


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);
		}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>