-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Test linear, quadratic, and double hashing.
Inside of linearProbing.test.ts quadraticProbing.test.ts doubleHashing.test.ts create new tests to account for the new f(k) function.
Updates
Now all function takes 3 extra prameters fType, a, b, c
- fType (string) containing either
"k","%", or"+"k-> f(k) = k%-> f(k) = k % c+-> f(k) = a * k + b
a, b, and care all integers associated with the above computations- Whether a, b, or c is used is dependent on the value of
fType. IffType=+then the value ofcdoesn't matter.
- Whether a, b, or c is used is dependent on the value of
Tests
Focus on testing for when the collisions occur so pick numbers that you know will for sure collide to ensure that the probing methods work as expected.
For accuracy use a calculator to ensure that the collisions are appropriately resolved.
- 3 tests for each type of
f(k)(i.ek, %, +) maps to the same index several times (9 tests) - 2 tests for each
f(k)using linear probing, with a given stepsize (2 tests) - 3 tests for each
f(k)where the capacity is not 10 (~9 tests you can apply this test to the nine from number 1) - at least 3 of your own tests that use some arbitary combination of values for each
f(k)(~9 tests)
Reactions are currently unavailable