Skip to content

Instantly share code, notes, and snippets.

@opyate
Last active December 2, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opyate/eda45b57c488933cf828 to your computer and use it in GitHub Desktop.
Save opyate/eda45b57c488933cf828 to your computer and use it in GitHub Desktop.
model and maximizer
package app;
public class Cake {
private Integer weight;
private Integer value;
public Cake(Integer weight, Integer value) {
this.weight = weight;
this.value = value;
}
public Integer getWeight() {
return this.weight;
}
public Integer getValue() {
return this.value;
}
}
package app;
import java.util.List;
public class Maximizer {
public Integer getMax(List<Cake> cakes, Integer capacity) {
assert(capacity >= 0): "Negative capacity bag not allowed";
// TODO provide an implementation below this line
Integer answer = 0;
return answer;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment