recategorized by
11,724 views
25 votes
25 votes

Consider the following heap (figure) in which blank regions are not in use and hatched region are in use.

The sequence of requests for blocks of sizes $300, 25, 125, 50$ can be satisfied if we use

  1. either first fit or best fit policy (any one)

  2. first fit but not best fit policy

  3. best fit but not first fit policy

  4. None of the above

recategorized by

3 Answers

Best answer
36 votes
36 votes

In the first fit, block requests will be satisfied from the first free block that fits it.

  • The request for $300$ will be satisfied by a $350$ size block reducing the free size to $50$.
  • Request for $25$, satisfied by $150$ size block, reducing it to $125.$
  • Request for $125$ satisfied by $125$ size block.
  • And request for $50$ satisfied by the $50$ size block.

So, all requests can be satisfied.

In the best fit strategy, a block request is satisfied by the smallest block that can fit it.

  • The request for $300$ will be satisfied by a $350$ size block reducing the free size to $50$.
  • Request for $25$, satisfied by $50$ size block as its the smallest size that fits $25$, reducing it to $25$.
  • Request for $125$, satisfied by $150$ size block, reducing it to $25$.

Now, the request for $50$ cannot be satisfied as the two $25$ size blocks are not contiguous.

So, answer (B).

edited by
5 votes
5 votes
it should be b) because.. by using best fit external fragmentation will be there..
0 votes
0 votes
Only first fit
Answer:

Related questions

33 votes
33 votes
2 answers
1
Kathleen asked Oct 4, 2014
11,275 views
A memory page containing a heavily used variable that was initialized very early and is in constant use is removed thenLRU page replacement algorithm is usedFIFO page rep...
34 votes
34 votes
4 answers
4
Kathleen asked Oct 5, 2014
19,576 views
Consider the resource allocation graph in the figure.Find if the system is in a deadlock stateOtherwise, find a safe sequence