Class FilesDisc2

java.lang.Object
topics.greedy.FilesDisc2

public class FilesDisc2 extends Object
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 Details

    • FilesDisc2

      public FilesDisc2(int[] files, int discCapacity)
      Constructor for FilesDisc1 objects
      Parameters:
      files - Size of the files used
      discCapacity - 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