Chapter 7 introduced the ‘hash table’ for direct access to an array without using sequential or binary searches. This case study will apply the processes involved.
Ace Office Products needs to store the inventory of its products in a table whose contents may be accessed directly.
The data consists of a product code, which is a unique key, the name of the item and the number of each item in stock. Other data such as unit cost could be included, but we will restrict the data stored to the first three, although you might wish to extend the program to include such additional information.
The operations to be carried out are