Which of the following heap memory E allocation strategies is likely to…

2023

Which of the following heap memory E allocation strategies is likely to exploit spatial locality of memory accesses in a program, the most?

  1. A.

    Best fit

  2. B.

    next fit

  3. C.

    last fir

  4. D.

    first fit

Attempted by 15 students.

Show answer & explanation

Correct answer: B

Next Fit is the strategy that best exploits spatial locality. It continues searching from the last allocated position, clustering new memory blocks near previous ones in the heap. This reduces the distance between related data objects compared to First Fit or Best Fit, which may scatter allocations.

Explore the full course: Niacl Ao It Specialist