Closed
Description
In the implementation of the get
function, the returned value is not the correct index found by the while loop, instead of the original index.
As a result, the first result will be returned instead of the expected one.
As follows
const test = new HashTableLinearProbing();
test.put('Jonathan', '5Jonathan');
test.put('Jamie','5Jamie')
test.put('Jack','7Jack');
test.put('Athelstan', '7Athelstan')
test.get('Jamie') // => 5Jonathan
test.get('Athelstan') // => 7Jack
So I submitted a PR about fixing this problem. #207
Metadata
Metadata
Assignees
Labels
No labels