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

Commit c5aec57

Browse files
committed
What's wrong ?
1 parent f3fe9b4 commit c5aec57

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

dining.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
0
2-
0
3-
0
4-
0
1+
1
2+
1
3+
1
4+
1

src/dining.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ static int minDist(int dist[], boolean[] set1) {
1616
public static int status = -1;
1717
public static int[] arr;
1818
public static int[] pasture;
19-
public static List<IPair> pastures = new ArrayList<IPair>();
20-
19+
//public static List<IPair> pastures = new ArrayList<IPair>();
20+
public static List<Integer> pastures = new ArrayList<Integer>();
2121
public static int[] dijkstra(int[][] graph1, int startVertex) {
2222
status = 0;
2323
int N = graph1.length;
@@ -50,7 +50,8 @@ public static int[] dijkstra(int[][] graph1, int startVertex) {
5050
edgeDistance;
5151

5252
}
53-
if(pastures.contains(new IPair(nearestVertex,vertexIndex))) {
53+
//if(pastures.contains(new IPair(nearestVertex,vertexIndex))) {
54+
if(pastures.contains(nearestVertex) || pastures.contains(vertexIndex)) {
5455
System.out.println("Info: "+nearestVertex+" "+vertexIndex);
5556
System.out.println("Set "+(nearestVertex - 1) + " and "+(vertexIndex - 1));
5657
arr[nearestVertex] = 1;
@@ -118,7 +119,8 @@ public static void main(String[] args) throws IOException{
118119
}
119120

120121
}
121-
pastures.add(new IPair(x,y));
122+
pastures.add(x);
123+
//pastures.add(new IPair(x,y));
122124

123125
}
124126
// End modification

0 commit comments

Comments
 (0)