hey i am beginner student and i have a project.Someone can help me or explain me . My project that is
An external text file stores a set of records. Each record has three values:
The key field, for example a 5-digit number 25645
A string, for example “purple car”
An integer quantity, for example 40.
The records are currently stored in an external text file. Each record is separated by a new
line, each field is separated by a comma, for example:
25645,”purple car”,40 64581,”vintage hat”, 100
A program is needed to import the data records and store them in a hash table for quick access.
The program uses a 1-D array to store the records in the hash table. The 1-D array needs to have capacity of ONE THOUSAND (1000) records. Each record has a key field which is a FIVE (5)-digit number. A hash function is performed on the key field to identify the index to store the record in the array.
The hash function divides the key field by ONE THOUSAND (1000) and the remainder gives the index.
The hash table uses linear probing to manage collisions. A collision is when an array index already contains data. The index is incremented until an empty index is found to store the data or the algorithm detects that the hash table is full. If data is being searched for and the data is not in the index identified by the hash value, the next index is checked until the value is found.
i think that i will use both 1 D array and hash Table.
Kaung Myat Thu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.