Skip to content

Commit ce0187e

Browse files
committed
HashTable: Rename rehash to resize
1 parent 503deba commit ce0187e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/lists/HashTable.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public V get(K key) {
130130
return null;
131131
}
132132

133-
private void rehash(int newCapacity) {
133+
private void resize(int newCapacity) {
134134
Object[] newBuckets = new Object[this.capacity = newCapacity];
135135

136136
for (Object bucket: this.buckets) {
@@ -149,11 +149,11 @@ private void rehash(int newCapacity) {
149149
}
150150

151151
private void expand() {
152-
this.rehash(this.capacity * 2);
152+
this.resize(this.capacity * 2);
153153
}
154154

155155
public void shrink(float minimumLoadFactor) {
156-
this.rehash((int) Math.ceil(this.length / minimumLoadFactor));
156+
this.resize((int) Math.ceil(this.length / minimumLoadFactor));
157157
}
158158

159159
public float measureClustering() {

0 commit comments

Comments
 (0)