Question: I need to create a Java program with 2 linked lists as a memory management routine to a larger program. It needs to do a

I need to create a Java program with 2 linked lists as a memory management routine to a larger program. It needs to do a First Fit, Best Fit and Worst Fit algorithm when finding open memory. I am having trouble with the Linked List commands but here is the starter code.

import java.util.LinkedList;

public class OpenMem {

public OpenMem () {} public boolean findOpenMem ( PCB PCB_Ready ,LinkedList QMemOpen ,LinkedList QMemUsed ) { boolean memFound__B = false ; int memNeed = PCB_Ready.get_Limit() ; //@0100 for (int ii = 0; ii < QMemOpen.size(); ii ++) { PCB memOpen = QMemOpen.get(ii) ; //@0120 if (memOpen.get_Limit() > memNeed ) //@0200 { memFound__B = true; int base0 = memOpen.get_memBase() ; //@0220 split the open memory @@ QMemOpen @@

//@0240 replace the open memory

//@0260 allocate the used memory @@ QMemUsed @@ //@0280 set the base for the process //@0300 push the used memory System.out.printf("@0300 Used\t%s " ,memUsed.showPCB()); break ; // exit out of the FOR loop for memory } } return memFound__B ; } }

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!