Repository navigation
Expand file tree
/
Copy pathP044Test.java
More file actions
49 lines (45 loc) · 1.51 KB
/
Copy pathP044Test.java
File metadata and controls
49 lines (45 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package ch13;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class P044Test {
@Test
void P044_1() {
P044_1 s = new P044_1();
assertEquals(
5,
s.networkDelayTime(
new int[][] {
new int[] {3, 1, 5},
new int[] {3, 2, 2},
new int[] {2, 1, 2},
new int[] {3, 4, 1},
new int[] {4, 5, 1},
new int[] {5, 6, 1},
new int[] {6, 7, 1},
new int[] {7, 8, 1},
new int[] {8, 1, 1},
},
8,
3));
}
@Test
void P044_2() {
P044_2 s = new P044_2();
assertEquals(
5,
s.networkDelayTime(
new int[][] {
new int[] {3, 1, 5},
new int[] {3, 2, 2},
new int[] {2, 1, 2},
new int[] {3, 4, 1},
new int[] {4, 5, 1},
new int[] {5, 6, 1},
new int[] {6, 7, 1},
new int[] {7, 8, 1},
new int[] {8, 1, 1},
},
8,
3));
}
}