Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcreated new hashing data structure #1026
Conversation
protected Open_Addressing(int index, int seed) { | ||
this.index = index; | ||
this.hasher = (int) (index - 1) / 2 + 1; | ||
this.tableSize = power2(hasher); |
yanglbme
Oct 12, 2019
Member
where's the method power2()
?
where's the method power2()
?
furahadamien
Oct 12, 2019
Author
Contributor
I had forgotten the function in my first commit. Now added
I had forgotten the function in my first commit. Now added
* the Open_Addressing object uses an array for hashing | ||
* using quadratic hashing, we make it possible to add an element and retrieve its value from the array in constant time | ||
*/ | ||
public class Open_Addressing { |
yanglbme
Oct 12, 2019
Member
It should be OpenAddressing
, not Open_Addressing
.
It should be OpenAddressing
, not Open_Addressing
.
furahadamien
Oct 12, 2019
Author
Contributor
Changed the name in my second commit
Changed the name in my second commit
/** | ||
* Calculate 2^index | ||
*/ | ||
public static int power2(int index) { | ||
return (int) Math.pow(2, index); | ||
} |
furahadamien
Oct 12, 2019
Author
Contributor
added the power function that was requested
added the power function that was requested
public class Open_Addressing { | ||
public class OpenAddressing { |
furahadamien
Oct 12, 2019
Author
Contributor
renamed the class
renamed the class
created a new data structure that uses open addressing for hashing. uses a quadratic hashing technique to generate the hash key