Here is the pseudo-code for an algorithm designed to count how many recorded temperatures are over 30 degrees.
SET count TO 0
FOR EACH temp FROM temperatures DO
IF (temp > 30) THEN
SET count TO count + 1
END IF
END FOREACH
SEND "Hot days: " & count TO DISPLAY
Here is a small dataset sorted in descending order. It is stored in the array called temperatures:
28, 25, 22, 19, 15, 12
Describe one inefficiency when executing this algorithm with this dataset.