Express the algorithm for insertion and deletion of index entries in the extendable hashing schema using pseudocode.

What will be an ideal response?


```
proc insert(ent)

// ent is the entry to be inserted;
// h is a hash function that that produces b bits;
// ch is the current hash level;
// D[i] is the i th entry in the directory;
// bl[i] is the level of the i th bucket

if bucket ?D[hch(ent)] is not full then store ent in that bucket;
else // D[hch(ent)] is full, call that bucket Bi
if bl [i ] < ch then
create a new bucket, Bi +2ch ?1;
D[i + 2ch?1]= &(Bi +2ch ?1); // store pointer to new bucket in directory
//rehash the elements of Bi to Bi and Bi +2ch ?1
put each element, e, of Bi in D[hch(e)];
bl [i ] and bl [i + 2ch?1] are set to bl [i]+ 1;
insert(ent); return;
else //bl[i]= ch
if ch = b then halt;
else // split directory
ch := ch + 1;
( i)(2ch?1 i < 2ch) D[i] := D[i - 2ch?1];
( i)(2ch?1 i < 2ch) bl [i ] := bl [i - 2ch?1];
insert(ent); return;
endproc
```

![14912|621x337](upload://s3fS9KMjiwJ5uMG4zXcZU7aHbk2.png)

Computer Science & Information Technology

You might also like to view...

Implement the University Accommodation Office database using the physical design created in 18.9.

What will be an ideal response?

Computer Science & Information Technology

The width taken up by an element is calculated as ____.

A. total width = content width + padding + border width B. total width = content width + padding C. total width = padding + border width D. total width = content width + border width

Computer Science & Information Technology

Match the following protocols with their function

I. HTTP II. FTP III. SMTP IV. DHCP V. POP A. Requesting/receiving an IP address B. Receiving email C. Requesting/delivering webpages D. Transferring files between computers E. Sending email

Computer Science & Information Technology

You can display a color palette by clicking the _____________________ box arrow in the Background section in the Table Properties dialog box.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology