I want tos ask why this question also have the temporal locality, the correct answer is Center image description here
I think the question is not well asked. Locality refers to the algorithm itself. For example, the use of data in this loop itself has temporal and spatial locality. The array itself is a data structure, there is no such thing as locality.