Skip to content

Commit 1b2ab6b

Browse files
authored
Update index.md
1 parent 672f9ef commit 1b2ab6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The first step is create a graph structure. The [Graph class](https://algorithms
1818
In the following Java code we create a graph structure with eight nodes. We use [Character](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Character.html) class for vertex identification and [Integer](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Integer.html) for the distance. You can see the graphic representation of the scheme [here](assets/complex.gif).
1919

2020
```java
21-
var graph = new Graph<Character>(Map.of(
21+
var graph = Graph.of(Map.of(
2222
'A', Map.of('B', 5, 'H', 2),
2323
'B', Map.of('A', 5, 'C', 7),
2424
'C', Map.of('B', 7, 'D', 3, 'G', 4),
@@ -65,7 +65,7 @@ Tests are written in groove language. For unit testing, the Spock framework was
6565
### Small Graph Sample
6666

6767
```groovy
68-
def graph = new Graph([
68+
def graph = Graph.of([
6969
A: [B: 7, C: 2],
7070
B: [A: 3, C: 5],
7171
C: [A: 1, B: 3]
@@ -78,7 +78,7 @@ Tests are written in groove language. For unit testing, the Spock framework was
7878
### Medium Graph Sample
7979

8080
```groovy
81-
def graph = new Graph([
81+
def graph = Graph.of([
8282
A: [B: 5],
8383
B: [A: 5, C: 10],
8484
C: [B: 20, D: 5],
@@ -92,7 +92,7 @@ Tests are written in groove language. For unit testing, the Spock framework was
9292
### Complex Graph Sample
9393

9494
```groovy
95-
def graph = new Graph([
95+
def graph = Graph.of([
9696
A: [B: 5, H: 2],
9797
B: [A: 5, C: 7],
9898
C: [B: 7, D: 3, G: 4],

0 commit comments

Comments
 (0)