A program stores data in a 1D array of records, HashTable. The array has space for 200 records. Each data item is stored in a specific index of the array that is calculated using an algorithm. The index is calculated from the key field using the formula: Key MOD 200 If two key fields generate the same index, there is a collision. Any records that have a collision are stored in a second array, Spare. This array has space for 100 records. When a collision is detected, the record is stored in the next free space in Spare. The text file HashData.txt stores up to 200 rows of data to be stored into the hash table. Each row contains three integer numbers separated by commas. The first number is the key field, the second number is item 1 and the third number is item 2. For example: The first row in the text file contains: $$\(646,12,568\)$$ The key field is 646 , item 1 is 12 and item 2 is 568 The procedure CreateHashTable(): - opens the file HashData.txt - creates a record for each row of data in the file - calls InsertIntoHash () with each record. Write program code for CreateHashTable ()

Computer Science
IGCSE&ALevel
CAIE
Exam No:9618_s25_qp_42 Year:2025 Question No:2(e)

Answer:



Knowledge points:

19.1 Algorithms
20.2 File Processing and Exception Handling

Solution:

Download APP for more features
1. Tons of answers.
2. Smarter Al tools enhance your learning journey.
IOS
Download
Android
Download
Google Play
Download