Class FilesDisc1

java.lang.Object
topics.greedy.FilesDisc1

public class FilesDisc1 extends Object
GREEDY ALGORITHM PROBLEM: MAXIMIZE THE NUMBER OF FILES ON A DISK It has an optimal solution. The idea is: First the smallest files while the disc has enough space to copy them
Author:
vicegd
  • Constructor Details

    • FilesDisc1

      public FilesDisc1(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 files in a disc
      Returns:
      The number of files inserted in the disc