Java Reference
In-Depth Information
12.7 Write a function to transpose a sparse matrix as represented in Section 12.2.
12.8 Write a function to add two sparse matrices as represented in Section 12.2.
12.9 Write memory manager allocation and deallocation routines for the situation
where all requests and releases follow a last-requested, first-released (stack)
order.
12.10 Write memory manager allocation and deallocation routines for the situation
where all requests and releases follow a last-requested, last-released (queue)
order.
12.11 Show the result of allocating the following blocks from a memory pool of
size 1000 using first fit for each series of block requests.
State if a given
request cannot be satisfied.
(a) Take 300 (call this block A), take 500, release A, take 200, take 300.
(b) Take 200 (call this block A), take 500, release A, take 200, take 300.
(c) Take 500 (call this block A), take 300, release A, take 300, take 200.
12.12 Show the result of allocating the following blocks from a memory pool of
size 1000 using best fit for each series of block requests.
State if a given
request cannot be satisfied.
(a) Take 300 (call this block A), take 500, release A, take 200, take 300.
(b) Take 200 (call this block A), take 500, release A, take 200, take 300.
(c) Take 500 (call this block A), take 300, release A, take 300, take 200.
12.13 Show the result of allocating the following blocks from a memory pool of
size 1000 using worst fit for each series of block requests. State if a given
request cannot be satisfied.
(a) Take 300 (call this block A), take 500, release A, take 200, take 300.
(b) Take 200 (call this block A), take 500, release A, take 200, take 300.
(c) Take 500 (call this block A), take 300, release A, take 300, take 200.
12.14 Assume that the memory pool contains three blocks of free storage. Their
sizes are 1300, 2000, and 1000. Give examples of storage requests for which
(a) first-fit allocation will work, but not best fit or worst fit.
(b) best-fit allocation will work, but not first fit or worst fit.
(c) worst-fit allocation will work, but not first fit or best fit.
12.6
Projects
12.1 Implement the orthogonal list sparse matrix representation of Section 12.2.
Your implementation should support the following operations on the matrix:
• insert an element at a given position,
• delete an element from a given position,
• return the value of the element at a given position,
• take the transpose of a matrix,
Search WWH ::




Custom Search