Skip to content

Commit 2bcae52

Browse files
authored
Rename CPUalgorithms to MemoryManagmentAlgorithms (TheAlgorithms#3071)
1 parent e5057de commit 2bcae52

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/main/java/com/thealgorithms/others/CPUalgorithms.java renamed to src/main/java/com/thealgorithms/others/MemoryManagementAlgorithms.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import java.util.ArrayList;
77

8-
public abstract class CPUalgorithms {
8+
public abstract class MemoryManagementAlgorithms {
99

1010
/**
1111
* Method to allocate memory to blocks according to CPU algorithms.
@@ -26,7 +26,7 @@ public abstract class CPUalgorithms {
2626
/**
2727
* @author Dekas Dimitrios
2828
*/
29-
class BestFitCPU extends CPUalgorithms{
29+
class BestFitCPU extends MemoryManagementAlgorithms {
3030

3131
private static final int NO_ALLOCATION
3232
= -255; // if a process has been allocated in position -255,
@@ -110,7 +110,7 @@ public ArrayList<Integer> fitProcess(int[] sizeOfBlocks, int[] sizeOfProcesses)
110110
/**
111111
* @author Dekas Dimitrios
112112
*/
113-
class WorstFitCPU extends CPUalgorithms{
113+
class WorstFitCPU extends MemoryManagementAlgorithms {
114114

115115
private static final int NO_ALLOCATION
116116
= -255; // if a process has been allocated in position -255,
@@ -177,7 +177,7 @@ public ArrayList<Integer> fitProcess(int[] sizeOfBlocks, int[] sizeOfProcesses)
177177
/**
178178
* @author Dekas Dimitrios
179179
*/
180-
class FirstFitCPU extends CPUalgorithms{
180+
class FirstFitCPU extends MemoryManagementAlgorithms {
181181

182182
private static final int NO_ALLOCATION
183183
= -255; // if a process has been allocated in position -255,
@@ -236,7 +236,7 @@ public ArrayList<Integer> fitProcess(int[] sizeOfBlocks, int[] sizeOfProcesses)
236236
/**
237237
* @author Alexandros Lemonaris
238238
*/
239-
class NextFit extends CPUalgorithms{
239+
class NextFit extends MemoryManagementAlgorithms {
240240

241241
private static final int NO_ALLOCATION
242242
= -255; // if a process has been allocated in position -255,

src/test/java/com/thealgorithms/others/BestFitCPUTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BestFitCPUTest {
1616
int [] sizeOfProcesses;
1717
ArrayList<Integer> memAllocation = new ArrayList<>();
1818
ArrayList<Integer> testMemAllocation ;
19-
CPUalgorithms bestFit = new BestFitCPU();
19+
MemoryManagementAlgorithms bestFit = new BestFitCPU();
2020

2121
@Test
2222
void testFitForUseOfOneBlock() {
@@ -73,4 +73,4 @@ void testFitForMoreBlocksNoFit() {
7373
);
7474
assertEquals(testMemAllocation, memAllocation);
7575
}
76-
}
76+
}

src/test/java/com/thealgorithms/others/FirstFitCPUTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class FirstFitCPUTest {
1616
int [] sizeOfProcesses;
1717
ArrayList<Integer> memAllocation = new ArrayList<>();
1818
ArrayList<Integer> testMemAllocation ;
19-
CPUalgorithms firstFit = new FirstFitCPU();
19+
MemoryManagementAlgorithms firstFit = new FirstFitCPU();
2020

2121
@Test
2222
void testFitForUseOfOneBlock() {
@@ -73,4 +73,4 @@ void testFitForMoreBlocksNoFit() {
7373
);
7474
assertEquals(testMemAllocation, memAllocation);
7575
}
76-
}
76+
}

src/test/java/com/thealgorithms/others/NextFitTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class NextFitCPUTest {
1616
int [] sizeOfProcesses;
1717
ArrayList<Integer> memAllocation = new ArrayList<>();
1818
ArrayList<Integer> testMemAllocation ;
19-
CPUalgorithms nextFit = new NextFit();
19+
MemoryManagementAlgorithms nextFit = new NextFit();
2020

2121
@Test
2222
void testFitForUseOfOneBlock() {
@@ -73,4 +73,4 @@ void testFitForMoreBlocksNoFit() {
7373
);
7474
assertEquals(testMemAllocation, memAllocation);
7575
}
76-
}
76+
}

src/test/java/com/thealgorithms/others/WorstFitCPUTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class WorstFitCPUTest {
1616
int [] sizeOfProcesses;
1717
ArrayList<Integer> memAllocation = new ArrayList<>();
1818
ArrayList<Integer> testMemAllocation ;
19-
CPUalgorithms worstFit = new WorstFitCPU();
19+
MemoryManagementAlgorithms worstFit = new WorstFitCPU();
2020

2121
@Test
2222
void testFitForUseOfOneBlock() {
@@ -84,4 +84,4 @@ void testFitBadCase() {
8484
);
8585
assertEquals(testMemAllocation, memAllocation);
8686
}
87-
}
87+
}

0 commit comments

Comments
 (0)