Skip to content

Commit 0d56427

Browse files
authored
Merge pull request loiane#207 from Yamiqu/main
fix: hash-table-linear-probing get function
2 parents b1eb1c0 + a9ba9d8 commit 0d56427

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/js/data-structures/hash-table-linear-probing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default class HashTableLinearProbing {
5151
index++;
5252
}
5353
if (this.table[index] != null && this.table[index].key === key) {
54-
return this.table[position].value;
54+
return this.table[index].value;
5555
}
5656
}
5757
return undefined;

src/ts/data-structures/hash-table-linear-probing.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class HashTableLinearProbing<K, V> {
5454
index++;
5555
}
5656
if (this.table[index] != null && this.table[index].key === key) {
57-
return this.table[position].value;
57+
return this.table[index].value;
5858
}
5959
}
6060
return undefined;

0 commit comments

Comments
 (0)