Data Structures - Open Addressing - Add/Remove/Load Factor
A _________ _________ tells how full or dense a table is
A load factor tells how full or dense a table is
An alternative option for deleting(linear probe) is known as _________ _________.
An alternative option for deleting(linear probe) is known as lazy deletion.
An _________ state during deletion marks a space where there isn't something there now, but at one point there was. This is what the _________ _________ tells us.
An unoccupied state during deletion marks a space where there isn't something there now, but at one point there was. This is what the sentinel key tells us.
The 4 Steps of Search
Hash the key that is being searched for to find its home index If the home index is empty, return not found If the home index contains the key being search for, return found If the home index contains anything else, follow the probe sequence
If we are trying to remove an element with open addressing(linear probing) we cant simply _________ an element.
If we are trying to remove an element with open addressing(linear probing) we cant simply delete an element.
If we are using Double Hashing to remove or delete, _________ _________ is the only option. This because we have no way of knowing what the empty space will be
If we are using Double Hashing to remove or delete, lazy deletion is are only option. This because we have no way of knowing what the empty space will be
In lazy deletion(linear probe) we search the probe sequence for the item we want to delete, instead of making the index empty we mark it as "_________ but not empty" or replace it with a "_________". These marked indexes are emptied either periodically or when the table is rehashed.
In lazy deletion(linear probe) we search the probe sequence for the item we want to delete, instead of making the index empty we mark it as "unoccupied but not empty" or replace it with a "sentinel key"/ These marked indexes are emptied either periodically or when the table is rehashed.
In the situation where we have a collision and the search for something that isn't there(not in the array), the search will take _________ to complete
In the situation where we have a collision and the search for something that isn't there(not in the array), the search will take longer to complete
Most hash tables maintain load factor between _________ and _________ (java.util.HashMap _________)
Most hash tables maintain load factor between 0.5 and 0.8 (java.util.HashMap 0.75)
The first 3 steps of search are O(1) time. The 4th is where we account for _________
The first 3 steps of search are O(1) time. The 4th is where we account for collision
The load factor is computed as the ratio of the number of _________ in the table to the _________ of the table
The load factor is computed as the ratio of the number of elements in the table to the capacity of the table
The load factor sets a _________ to let us know when to _________ our table so that it isn't full and maintains some empty space.
The load factor sets a threshold to let us know when to rehash our table so that it isn't full and maintains some empty space.
The more _________ the table is, the more likely collisions are to occur and that will further degrade the performance of the table
The more dense the table is, the more likely collisions are to occur and that will further degrade the performance of the table
The new _________ in our hash function changes when we rehash
The new divisor in our hash function changes when we rehash
When deleting(linear probe), we have to move the elements in the remaining _________ _________ closer to their home bucket(if possible) by using the new empty bucket
When deleting(linear probe), we have to move the elements in the remaining probe sequence closer to their home bucket(if possible) by using the new empty bucket
When we rehash, it is similar to resizing an array_________
When we rehash, it is similar to resizing an array