UC3M

Telematic/Audiovisual Syst./Communication Syst. Engineering

Systems Architecture

September 2017 - January 2018

7.9.  Activities

7.9.1.  Implementing a hash table

Resources

  • Hash Tables

  • Implementation of the functions required to manipulate a linked list of elements (create, insert, delete, search, etc.)

Work Plan

  1. Read the document Hash Tables

  2. Propose a data structure containing a hash table. This structure is the one to be manipulated in the application, that is, it will be created by a function written by you, and will be received as parameter in the functions to search, add, delete, etc.

  3. Write the function to create a new hash table. Decide which parameters need to be received.

  4. Write the function that given a hash table and a key, search if such key exists. Returns the value associated with that key or NULL otherwise.

  5. Write the function that given a hash table, a key and a value, adds the pair (key, value) to the table. It is assumed that the key is not present in the table before executing the operation.

  6. Write a function that receives a hash table and destroys it. This implies destroying all the collision lists.

  7. Modify the table structure to have a parameter with name density. When the table density goes beyond that value, the table must be increased by 25%. This must happen transparently whenever the insertion of a new pair (key, value) is executed.