Assume there is a free list which contains nodes and is filled with a value if it is already assigned and the value will be the size of

Quang Hiếu

New member
Assume there is a free list which contains nodes and is filled with a value if it is already assigned and the value will be the size of requested block else will be 0.
Code:
 z = startpoint;
 while ((z < end) &#038;&#038;    \\ didn't reach end
   (*z <= len))          \\ too small to satisfy request
 {           
   assign this block
 }
The above code represents what?
A. code for first fit
B. code for best fit
C. code for worst fit
D. none of the mentioned
 
Answer: A
Explanation: As z is start point and now from beginning we are moving and checking if we reached end and then checking size naively assigning the first block which is bigger than required size hence it is first fit.
 

Tìm kiếm

Back
Top