Discuss the methods for a hash file to expand and shrink dynamically. What are the advantages and disadvantages of each?
The hashing methods that permit dyanamic file expansion are:
(i) Extendible hashing
(ii) Linear hashing
The major advantage of extendible hashing that makes it attractive is that performance of the file does not degrade as the file grows. Also, no space is allocated in extendible hashing for future growth, but additional buckets can be allocated dynamically as needed.
A disadvantage is in which the directory must be searched before accessing the buckets themselves, resulting in two blocks accesses on the other hand of one in static hashing.