public class Dijkstra
extends java.lang.Object
| Constructor and Description |
|---|
Dijkstra() |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
dijkstra(java.util.ArrayList<java.util.ArrayList<Pair<java.lang.Integer,java.lang.Integer>>> adj,
int n,
int start)
Dijkstra’s algorithm solves the single-source shortest-paths problem on a weighted, directed
graph for the case in which all edge weights are nonnegative
Time complexity: O(|E| + |V|log|V|)
Space complexity: TODO
|
public static int[] dijkstra(java.util.ArrayList<java.util.ArrayList<Pair<java.lang.Integer,java.lang.Integer>>> adj, int n, int start)