Screen Shot 2021-11-15 at 11.40.11 AM.png

Extendable Hashing

  1. Use i of b bits from hash output, increasing i as needed

    Screen Shot 2021-11-17 at 10.23.42 AM.png

  2. Add a level of indirection: directory of pointers to hash buckets

    Screen Shot 2021-11-17 at 10.24.08 AM.png

Extendable Hash : Insertion

i number for the bucket: how many times the bucket has been split and how many same bits does each entry in the buckets have

Extendable Hash : Deletion

We can simply delete it, but we can also find a more compact way that after the deletion, we can merge the buckets

and if the i number on the buckets are smaller than the directory, we can shrink the directory size by half

Merge Condition

Extendable Hash can't provide minimum space guarantee in case like this. We only has 3 tuples but we have to split 4 times

This can only be solved by choosing a better hash function to make the tuples be more spread out

Screen Shot 2021-11-18 at 11.27.59 AM.png