File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
yoonexample/src/main/java/graph Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ package graph ;
2
+
3
+ import list .DummyDoublyLinkedList ;
4
+ import list .List ;
5
+
6
+ public class ListGraph implements Graph {
7
+
8
+ private final List <Enum <?>>[] vertexes ;
9
+
10
+ public ListGraph (int vertexCount , Class <? extends Enum <?>> clazz ) {
11
+ Enum <?>[] enumConstants = clazz .getEnumConstants ();
12
+ int min = Math .min (vertexCount , enumConstants .length );
13
+
14
+ this .vertexes = new List [min ];
15
+ for (int i = 0 ; i < min ; i ++) {
16
+ this .vertexes [i ] = new DummyDoublyLinkedList <>();
17
+ this .vertexes [i ].insert (enumConstants [i ]);
18
+ }
19
+ }
20
+
21
+ @ Override
22
+ public void addEdge (Enum <?> fromV , Enum <?> toV ) {
23
+ }
24
+
25
+ @ Override
26
+ public String showGraphEdgeInfo () {
27
+ return null ;
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments