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 procedure PrintSpare () outputs the key field of each element in the array Spare that does not contain an empty record. Write program code for PrintSpare () (ii) The main program should call the procedure to initialise the arrays, call the procedure to create the hash table and then call the procedure to output the contents of the array Spare Write program code for the main program. (iii) Test your program. Take a screenshot of the output(s).

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

Answer:







Knowledge points:

19.1 Algorithms
20.1 Programming Paradigms

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