I want to writ a java that would read from a file called memory.txt a list of partition sizes of K’s, one partition per line. It will then read from a file called processes.txt a list of processes requesting these partitions. Each line simple contain a list of sizes in K’s too. the code should work with any number of partitions and any number of processes.
The program should determine which partitions are taken for successive segment requests of the processes in processes.txt if the algorithm used is:
i) First Fit
ii) Best Fit
iii) Next Fit (continues from last allocated hole) iv)
iv) Worst Fit.
The program should finally display the total of internal fragmentation and external fragmentation of the algorithms above.