Consider a HeapManager m, as shown below, with an initial, empty memory array of 11 words, i.e., m = new HeapManager (new int[11]). Assume that the HeapManager implements best-fit mechanism for...



  1. Consider a HeapManager m, as shown below, with an initial, empty memory array of 11 words, i.e.,


m = new HeapManager (new int[11]).


Assume that the HeapManager implements best-fit mechanism for allocate and coalescing adjacent free blocks for deallocate.


Also consider a program that needs the following ordered sequence of memory allocation and deallocation service.


a = m.allocate(3);


b = m.allocate(1);


c = m.allocate(2);


d = m.allocate(1)


m.deallocate(a);


m.deallocate(d);


e = m.allocate(1);


m.deallocate(b);


m.allocate(5);


Is the HeapManager able to fulfill the above sequence of memory service request? Explain why it is or not.



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here