11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

428 Chap. 12 Lists <strong>and</strong> Arrays Revisited• add two m<strong>at</strong>rices, <strong>and</strong>• multiply two m<strong>at</strong>rices.12.2 Implement the Yale model for sparse m<strong>at</strong>rices described <strong>at</strong> the end of Section12.2. Your implement<strong>at</strong>ion should support the following oper<strong>at</strong>ions onthe m<strong>at</strong>rix:• insert an element <strong>at</strong> a given position,• delete an element from a given position,• return the value of the element <strong>at</strong> a given position,• take the transpose of a m<strong>at</strong>rix,• add two m<strong>at</strong>rices, <strong>and</strong>• multiply two m<strong>at</strong>rices.12.3 Implement the MemManager ADT shown <strong>at</strong> the beginning of Section 12.3.Use a separ<strong>at</strong>e linked list to implement the freelist. Your implement<strong>at</strong>ionshould work for any of the three sequential-fit methods: first fit, best fit, <strong>and</strong>worst fit. Test your system empirically to determine under wh<strong>at</strong> conditionseach method performs well.12.4 Implement the MemManager ADT shown <strong>at</strong> the beginning of Section 12.3.Do not use separ<strong>at</strong>e memory for the free list, but instead embed the free listinto the memory pool as shown in Figure 12.12. Your implement<strong>at</strong>ion shouldwork for any of the three sequential-fit methods: first fit, best fit, <strong>and</strong> worstfit. Test your system empirically to determine under wh<strong>at</strong> conditions eachmethod performs well.12.5 Implement the MemManager ADT shown <strong>at</strong> the beginning of Section 12.3using the buddy method of Section 12.3.1. Your system should supportrequests for blocks of a specified size <strong>and</strong> release of previously requestedblocks.12.6 Implement the Deutsch-Schorr-Waite garbage collection algorithm th<strong>at</strong> is illustr<strong>at</strong>edby Figure 12.18.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!