Skip to content

Commit 06e717e

Browse files
Update Bridges.java
1 parent 28877ae commit 06e717e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/main/java/com/thealgorithms/graph/Bridges.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public static List<int[]> findBridges(int vertexCount, int[][] edges) {
7676
}
7777
}
7878

79+
bridges.sort((first, second) -> {
80+
int comparison = Integer.compare(first[0], second[0]);
81+
return comparison != 0 ? comparison : Integer.compare(first[1], second[1]);
82+
});
83+
7984
return bridges;
8085
}
8186

0 commit comments

Comments
 (0)