Skip to content

Commit

Permalink
Add Path class.
Browse files Browse the repository at this point in the history
  • Loading branch information
theViz343 committed Nov 3, 2023
1 parent ff27eb0 commit a74906c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/Path.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import java.util.ArrayList;
import java.util.List;

public class Path {
List<String> path;
Path() {
path = new ArrayList<String>();
}

public void add(String node) {
path.add(node);
}

public void printPath() {
String s = String.join("->", path.reversed());
System.out.println(s);
}
}

0 comments on commit a74906c

Please sign in to comment.