Question: Write a program that implements the Buddy System algorithm for memory management. For input the program accepts 1) the amount of total available memory and

Write a program that implements the Buddy System algorithm for memory management. For input the program accepts 1) the amount of total available memory and 2) the sequence of integers with allocation (+) or return (-) requests. As output, the program must print the table showing the state of the memory (in the same way it is demonstrated in Lecture 6 after each allocation or return. Test the program with the following input parameters: Two megabytes of available memory and the following sequence: (A: +20K), (B: +35K), (C: +90K), (D: +40K), (E: +240K), (D: -40K), (A: -20K), (C: -90K), (B: -35K), (E: -240K). Turn in the listing of the program and the printout.

Write a program that implements the Buddy System algorithm for memory management.

A Buddy System Example Memor 128 K 256 K384K512K 640K 768 K 896K1,024K 1,024 : +70 128 | 128 B: +35K A 128 B6 C: +80KA 128 B6 A:-70K128 B6 D: +60 128 | B 64D 64 128 | 128 :-35 | 128 | 64 D:-60K :-80 512 512 512 512 512 512 512 256 256 128 | 128 128 128 128 128 256 128 128 1,024 K A Buddy System Example Memor 128 K 256 K384K512K 640K 768 K 896K1,024K 1,024 : +70 128 | 128 B: +35K A 128 B6 C: +80KA 128 B6 A:-70K128 B6 D: +60 128 | B 64D 64 128 | 128 :-35 | 128 | 64 D:-60K :-80 512 512 512 512 512 512 512 256 256 128 | 128 128 128 128 128 256 128 128 1,024 K

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!