Extendable hashing provides performance that does not degrade.We continue on for the deposit records of Figure 11.20, obtaining theĮxtendable hash structure of Figure 11.25.We rehash the entries in the old bucket.This necessitates doubling the bucket address table again to.So we must split that bucket, increasing the number of bits we must.Next we attempt to insert the Redwood record, and find it hashes to 1.We split the bucket, placing the records whose search key hashīegins with 1 in the new bucket, and those with a 0 in the old bucket.This makes us double the size of the bucket address table to two.Since, we need to increase the number of bits we use.When we insert the next record (Downtown), we must split the bucket.As we insert the Perryridge and Round Hill records, this first bucket.In order to illustrate both situations described. We (unrealistically) assume that a bucket can only hold 2 records,.An initial empty hash structure is shown in Figure 11.22.32-bit hash values on bname are shown in Figure 11.21.Insertion is illustrated for the example deposit file of Figure 11.20. īuckets may have to be coalesced, and bucket address table may have to be.Note that in both cases we only need to rehash records in bucket j. Rehash each record in bucket j as before.Leave the first half pointing to bucket j, and make the rest.Now adjust entries in the bucket address table that previously.We allocate a new bucket z, and set and to the.Prefixes that have the same value on the leftmost bits. Note that all entries that point to bucket j correspond to hash.Then we can split bucket j without increasing the size of the.If, then more than one entry in the bucket address table
0 Comments
Leave a Reply. |