diff --git a/src/main/java/Path.java b/src/main/java/Path.java new file mode 100644 index 0000000..3078ad9 --- /dev/null +++ b/src/main/java/Path.java @@ -0,0 +1,18 @@ +import java.util.ArrayList; +import java.util.List; + +public class Path { + List path; + Path() { + path = new ArrayList(); + } + + public void add(String node) { + path.add(node); + } + + public void printPath() { + String s = String.join("->", path.reversed()); + System.out.println(s); + } +}