The Fit That Survives

An allocator's free list, in list order, holds three blocks. Ignore headers, and assume no coalescing is possible because the gaps between these blocks are all in use.

position 0 1 2
block size (bytes) 30 18 26

Two requests arrive in this order:

p = malloc(16);
q = malloc(28);

More than one option is correct. Under which search policies does the second call return NULL?

A

best fit

B

first fit

C

next fit

D

worst fit