FAQ - 2020-2021-WY-AP-CS/bin-packing GitHub Wiki
-
Question: Is the test for
shipBin
supposed to have an output array list that is smaller than the initial one?Answer: Yes,
shipBin
changes the inputs, deleting items and their corresponding bins. -
Question: For the methods
BestFit
andNextFit
, what does theList<Integer> bins
contain?Answer: A list of the space used in each bin.
-
Question: Where are the videos?
Answer: Bin Packing intro and the walkthrough of this bin-packing code.
-
Question: I am getting array index out of bounds errors for my
NextFit
method and can't figure out why.Answer: The intent is not to modify the
bins
variable in this function (see PackingStrategy.java). Make sure the modification code is all contained inpackAll
. -
Question: Should we include the different ways to modify the bin in
packAll
and call on it in theNextFit
andBestFit
classes?Answer: This question describes an "inverted" control flow, not what you want. The
packAll
method should call theitemPlacer
from thePackingStrategy
(e.g.,NextFit
), then use that information to modify the bins.