Question 1 Report
A drone delivery company stores the route history for each drone in a dynamic array. A route record is appended whenever a delivery finishes. At first, the array has capacity for 100 records. The program allocates a new, larger array when the old one is full, copies existing records and changes the pointer used by the main program. This avoids a fixed upper limit, but copying can briefly delay the next command from the control room.
(a) Explain why a fixed array of 100 records could cause a problem. [1]
(b) When the array is resized, explain why the pointer held by the program must be updated. [2]
(a) A fixed array of 100 records can become full if more than 100 route records are entered, leaving no space for later routes. [1]
(b) The replacement array may be allocated at a different memory location. The program's pointer must be updated to refer to that new array so later reads and writes access valid route data. [2]
Everything you need to excel in your exams