


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Structured Event Scheduling
Algorithm for Dynamic Hashing Operation Procedure HashEnqueue(X) Hash to the appropriate bucket using a modulus and a hashing function applied to X Double the hash table size if the number of events is greater than 2 * number of buckets End HashEnqueue
Procedure HashDequeue Search all buckets for the event with the minimum time (make sure that time is within the current year) If no events are found for this year (a year of empty buckets), then take the minimum time event Remove the item from the table Halve the hash table size if the number of events is less than 0.5 * number of buckets End HashDequeue
Procedure HashCancel(X) Hash to appropriate bucket by applying the hashing function to X Locate X and remove it from the bucket list End HashCancel