Skip to content

Commit 8cc4c5d

Browse files
committed
set jdk to 1.7
1 parent f07e5fc commit 8cc4c5d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/cn/codepub/algorithms/graph/Kruskal.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,23 @@
2222
* @since V1.0.0
2323
*/
2424
public class Kruskal {
25+
private static List<Vertex> vertexList = new ArrayList<>();//顶点集
2526
/**
2627
* 实现一个匿名类,提供了基于边的权值的比较器
2728
*/
28-
public static final Queue<Edge> QUEUE = new PriorityQueue<Edge>(new Comparator() {
29+
public static final Queue<Edge> QUEUE = new PriorityQueue<Edge>(new Comparator<Edge>() {
2930
@Override
30-
public int compare(Object o1, Object o2) {
31-
Edge e1 = (Edge) o1;
32-
Edge e2 = (Edge) o2;
31+
public int compare(Edge e1, Edge e2) {
3332
if (e1.value == e2.value) {
3433
return 0;
3534
} else {
3635
return e1.value > e2.value ? 1 : -1;
3736
}
3837
}
3938
});
40-
private static List<Vertex> vertexList = new ArrayList<>();//顶点集
4139
private static List<Edge> visitedEdges = new ArrayList<>();//已访问的边集
4240
private static List<Edge> edgeList = new ArrayList<>();//边集
4341

44-
4542
private static class Vertex {
4643
char name;//顶点名称
4744

0 commit comments

Comments
 (0)