Class FilesDisc2
java.lang.Object
topics.greedy.FilesDisc2
GREEDY ALGORITHM PROBLEM: MINIMIZE THE FREE SPACE ON A DISK WITH FILES
It has NOT an optimal solution in some cases. The idea
is: First the biggest files while the disc has enough
space to copy them
- Author:
- vicegd
-
Constructor Summary
ConstructorsConstructorDescriptionFilesDisc2(int[] files, int discCapacity) Constructor for FilesDisc1 objects -
Method Summary
-
Constructor Details
-
FilesDisc2
public FilesDisc2(int[] files, int discCapacity) Constructor for FilesDisc1 objects- Parameters:
files- Size of the files useddiscCapacity- Maximum disc capacity
-
-
Method Details
-
calculate
public int calculate()Calculates the amount of used space in a disc- Returns:
- The amount of data used of a disc
-