Photo AI

P-Cubed uses GPS to track its delivery vans - Edexcel - GCSE Computer Science - Question 6 - 2018 - Paper 1

Question icon

Question 6

P-Cubed-uses-GPS-to-track-its-delivery-vans-Edexcel-GCSE Computer Science-Question 6-2018-Paper 1.png

P-Cubed uses GPS to track its delivery vans. (i) Here is the pseudo-code for an algorithm to find the number of mileages over 300. SET maximum TO LENGTH (mileage) ... show full transcript

Worked Solution & Example Answer:P-Cubed uses GPS to track its delivery vans - Edexcel - GCSE Computer Science - Question 6 - 2018 - Paper 1

Step 1

Describe one inefficiency when executing the algorithm with this dataset.

96%

114 rated

Answer

One inefficiency in executing the algorithm with this dataset is that it does not take advantage of any potential sorting in the data. Since the algorithm processes each element in a random order and compares it against the threshold (300), it must examine all items in the list regardless of whether there are any items above 300. If the data were sorted in ascending order, the algorithm could stop searching once it encounters the first number greater than 300, thus saving time by not checking the remaining numbers.

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;