Assignment
Assignment
Scanner;
private int n;
public BellmanFord(int n) {
this.n = n;
D[i] = MAX_VALUE;
D[s] = 0;
if (A[i][j] != MAX_VALUE) {
}
for (int i = 1; i <= n; i++) {
if (A[i][j] != MAX_VALUE) {
return;
int n = 0, s;
n = sc.nextInt();
A[i][j] = sc.nextInt();
if (i == j) {
A[i][j] = 0;
continue;
if (A[i][j] == 0) {
A[i][j] = MAX_VALUE;
s = sc.nextInt();
b.shortest(s, A);
sc.close();