Created
December 31, 2016 13:34
-
-
Save anonymous/4ab08ebcee413e316f3ec41f4e037600 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package myHashTable; | |
import java.util.Arrays; | |
public class assignment { | |
public static void main(String[] args) { | |
// keys to add | |
int[] keys = {517, 492, 27, 116, 132, 30, 552, 725, 627, 192}; | |
System.out.println("Keys to Add: " + Arrays.toString(keys)); | |
// HASH TABLE PROPERTIES | |
int capacity = 10; | |
double max_load_factor = 0.8; | |
int resize_factor = 2; | |
int probe_type = 1; // 1: Linear Probing, 2: Quadratic Probing | |
myHash hashTable = new myHash(capacity,max_load_factor,resize_factor, probe_type); | |
// add keys to the hash table | |
for (int i = 0; i<keys.length; i++) | |
hashTable.add(keys[i]); | |
hashTable.printHashTable(); // print hash table contents and statistics // Create another hash table to test quadratic probing | |
} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment