From b8653453d9c20e9797839af89085fa2f9b0ff521 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 27 Oct 2015 16:03:11 +0100 Subject: Using a type variable for a Node's content --- Practical1/src/nl/camilstaps/cs/GarbageCollectionHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Practical1/src/nl/camilstaps/cs/GarbageCollectionHelper.java') diff --git a/Practical1/src/nl/camilstaps/cs/GarbageCollectionHelper.java b/Practical1/src/nl/camilstaps/cs/GarbageCollectionHelper.java index 0da2dc5..ec1506d 100644 --- a/Practical1/src/nl/camilstaps/cs/GarbageCollectionHelper.java +++ b/Practical1/src/nl/camilstaps/cs/GarbageCollectionHelper.java @@ -17,7 +17,7 @@ class GarbageCollectionHelper { * @param args Command line arguments (are ignored) */ public static void main(String[] args) { - Graph graph = new Graph(); + Graph graph = new Graph(); int n_bins = readGraph(new Scanner(System.in), graph); System.out.println(graph.maximumIndependentSetSize() >= n_bins ? "possible" : "impossible"); } @@ -35,13 +35,13 @@ class GarbageCollectionHelper { * @param graph the Graph to build * @return the number of bins */ - private static int readGraph(Scanner sc, Graph graph) { + private static int readGraph(Scanner sc, Graph graph) { int n_edges = sc.nextInt(); int n_nodes = sc.nextInt(); int n_bins = sc.nextInt(); for (int i = 1; i <= n_nodes; i++) { - graph.addNode(new Node(i)); + graph.addNode(new Node<>(i)); } for (int i = 0; i < n_edges; i++) { -- cgit v1.2.3