Rename CPUalgorithms to MemoryManagmentAlgorithms (#3071)

This commit is contained in:
Utkarsh Yadav 2022-05-31 18:42:59 +05:30 committed by GitHub
parent e5057defa7
commit 2bcae52dce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 13 deletions

View File

@ -5,7 +5,7 @@ package com.thealgorithms.others;
import java.util.ArrayList; import java.util.ArrayList;
public abstract class CPUalgorithms { public abstract class MemoryManagementAlgorithms {
/** /**
* Method to allocate memory to blocks according to CPU algorithms. * Method to allocate memory to blocks according to CPU algorithms.
@ -26,7 +26,7 @@ public abstract class CPUalgorithms {
/** /**
* @author Dekas Dimitrios * @author Dekas Dimitrios
*/ */
class BestFitCPU extends CPUalgorithms{ class BestFitCPU extends MemoryManagementAlgorithms {
private static final int NO_ALLOCATION private static final int NO_ALLOCATION
= -255; // if a process has been allocated in position -255, = -255; // if a process has been allocated in position -255,
@ -110,7 +110,7 @@ class BestFitCPU extends CPUalgorithms{
/** /**
* @author Dekas Dimitrios * @author Dekas Dimitrios
*/ */
class WorstFitCPU extends CPUalgorithms{ class WorstFitCPU extends MemoryManagementAlgorithms {
private static final int NO_ALLOCATION private static final int NO_ALLOCATION
= -255; // if a process has been allocated in position -255, = -255; // if a process has been allocated in position -255,
@ -177,7 +177,7 @@ class WorstFitCPU extends CPUalgorithms{
/** /**
* @author Dekas Dimitrios * @author Dekas Dimitrios
*/ */
class FirstFitCPU extends CPUalgorithms{ class FirstFitCPU extends MemoryManagementAlgorithms {
private static final int NO_ALLOCATION private static final int NO_ALLOCATION
= -255; // if a process has been allocated in position -255, = -255; // if a process has been allocated in position -255,
@ -236,7 +236,7 @@ class FirstFitCPU extends CPUalgorithms{
/** /**
* @author Alexandros Lemonaris * @author Alexandros Lemonaris
*/ */
class NextFit extends CPUalgorithms{ class NextFit extends MemoryManagementAlgorithms {
private static final int NO_ALLOCATION private static final int NO_ALLOCATION
= -255; // if a process has been allocated in position -255, = -255; // if a process has been allocated in position -255,

View File

@ -16,7 +16,7 @@ class BestFitCPUTest {
int [] sizeOfProcesses; int [] sizeOfProcesses;
ArrayList<Integer> memAllocation = new ArrayList<>(); ArrayList<Integer> memAllocation = new ArrayList<>();
ArrayList<Integer> testMemAllocation ; ArrayList<Integer> testMemAllocation ;
CPUalgorithms bestFit = new BestFitCPU(); MemoryManagementAlgorithms bestFit = new BestFitCPU();
@Test @Test
void testFitForUseOfOneBlock() { void testFitForUseOfOneBlock() {

View File

@ -16,7 +16,7 @@ class FirstFitCPUTest {
int [] sizeOfProcesses; int [] sizeOfProcesses;
ArrayList<Integer> memAllocation = new ArrayList<>(); ArrayList<Integer> memAllocation = new ArrayList<>();
ArrayList<Integer> testMemAllocation ; ArrayList<Integer> testMemAllocation ;
CPUalgorithms firstFit = new FirstFitCPU(); MemoryManagementAlgorithms firstFit = new FirstFitCPU();
@Test @Test
void testFitForUseOfOneBlock() { void testFitForUseOfOneBlock() {

View File

@ -16,7 +16,7 @@ class NextFitCPUTest {
int [] sizeOfProcesses; int [] sizeOfProcesses;
ArrayList<Integer> memAllocation = new ArrayList<>(); ArrayList<Integer> memAllocation = new ArrayList<>();
ArrayList<Integer> testMemAllocation ; ArrayList<Integer> testMemAllocation ;
CPUalgorithms nextFit = new NextFit(); MemoryManagementAlgorithms nextFit = new NextFit();
@Test @Test
void testFitForUseOfOneBlock() { void testFitForUseOfOneBlock() {

View File

@ -16,7 +16,7 @@ class WorstFitCPUTest {
int [] sizeOfProcesses; int [] sizeOfProcesses;
ArrayList<Integer> memAllocation = new ArrayList<>(); ArrayList<Integer> memAllocation = new ArrayList<>();
ArrayList<Integer> testMemAllocation ; ArrayList<Integer> testMemAllocation ;
CPUalgorithms worstFit = new WorstFitCPU(); MemoryManagementAlgorithms worstFit = new WorstFitCPU();
@Test @Test
void testFitForUseOfOneBlock() { void testFitForUseOfOneBlock() {