Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit 6e2021b

Browse files
committed
Update dining.java
1 parent c8fcfac commit 6e2021b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dining.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void main(String[] args) throws IOException {
3030
//System.out.println("Cost without haybales: "+cost);
3131
//System.out.println("Graph as an edgelist: "+graph);
3232
int[] taste = new int[N];
33-
Pair key;
33+
//Pair key;
3434
List<Integer> bales = new ArrayList<>();
3535
//Map<Integer, Integer> haybales = new HashMap<>();
3636
//cost.get(new Pair(0,1));
@@ -39,15 +39,16 @@ public static void main(String[] args) throws IOException {
3939
int index = Integer.parseInt(st.nextToken()) - 1;
4040
bales.add(index);
4141
int value = Integer.parseInt(st.nextToken());
42-
42+
/*
4343
//costWithHaybales.get(new Pair(0,1));
4444
for(int node: graph.get(index)) {
45-
key = new Pair(index,node);//assert key.equals(new Pair(node,index));
45+
Pair key = new Pair(index,node);//assert key.equals(new Pair(node,index));
4646
//System.out.println("Map: "+costWithHaybales);
4747
//System.out.println(key+ " "+costWithHaybales.get(key));
4848
//costWithHaybales.put(key,
4949
// costWithHaybales.get(key) - value);
5050
}
51+
*/
5152
taste[index] = value;
5253
}
5354
//System.out.println("Cost with haybales: "+costWithHaybales);
@@ -62,7 +63,7 @@ public static void main(String[] args) throws IOException {
6263
PriorityQueue<Integer> nextNodes = new PriorityQueue<>(new Comparator<Integer>() {
6364
@Override
6465
public int compare(Integer arg0, Integer arg1) {
65-
return Integer.compare(dining.distTo[arg1], dining.distTo[arg0]);
66+
return Integer.compare(dining.distTo[arg0], dining.distTo[arg1]);
6667
//return 0;
6768
}
6869
});
@@ -89,7 +90,7 @@ public int compare(Integer arg0, Integer arg1) {
8990
PriorityQueue<Integer> nextNodesOrig = new PriorityQueue<>(new Comparator<Integer>() {
9091
@Override
9192
public int compare(Integer arg0, Integer arg1) {
92-
return Integer.compare(dining.distOrig[arg1], dining.distOrig[arg0]);
93+
return Integer.compare(dining.distOrig[arg0], dining.distOrig[arg1]);
9394
//return 0;
9495
}
9596
});

0 commit comments

Comments
 (0)