-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
53 lines (44 loc) · 1.7 KB
/
Node.java
File metadata and controls
53 lines (44 loc) · 1.7 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
50
51
52
53
package Human;
import java.util.ArrayList;
import java.util.List;
@SuppressWarnings( "WriteOnlyObjekt")
public class Node {
public Node(Object o, int i) {
}
public static void node(String[] args){
Node pointOne = new Node(null, 1);
Node pointTwo = new Node(null,2);
Node pointThree = new Node(null,3);
Node pointFour = new Node(null,4);
Node pointFive = new Node(null,5);
Node pointSix = new Node(null,6);
Node additional = new Node(null,7);
List<Node> formOne = new ArrayList<>();
formOne.add(pointTwo);
formOne.add(pointThree);
pointOne.setRib(formOne);
List<Node> fromThree = new ArrayList<>();
fromThree.add(pointFour);
fromThree.add(pointFive);
pointThree.setRib(fromThree);
List<Node> fromFive = new ArrayList<>();
fromFive.add(pointSix);
pointFive.setRib(fromFive);
List<Node> fromSix = new ArrayList<>();
fromSix.add(pointThree);
pointSix.setRib(fromSix);
List<Node> fromAddtional = new ArrayList<>();
fromAddtional.add(pointOne);
fromAddtional.add(pointTwo);
fromAddtional.add(pointThree);
fromAddtional.add(pointFour);
fromAddtional.add(pointFive);
fromAddtional.add(pointSix);
additional.setRib(fromAddtional);
}
private void setRib(List<Node> formOne) {
}
}
//Путь из Рекьявика в Афины:
//Рекьявик (4) + Лондон (3) + Берлин(2) +Рим(2) + Афины = 9
//Это самый короткий путь - https://waksoft.susu.ru/wp-content/uploads/2021/10/graph-schame.jpg