MCPcopy Index your code
hub / github.com/wangzheng0822/algo / print

Method print

java/30_graph/Graph.java:64–69  ·  view source on GitHub ↗
(int[] prev, int s, int t)

Source from the content-addressed store, hash-verified

62 }
63
64 private void print(int[] prev, int s, int t) { // 递归打印 s->t 的路径
65 if (prev[t] != -1 && t != s) {
66 print(prev, s, prev[t]);
67 }
68 System.out.print(t + " ");
69 }
70
71 public static void main(String[] args) {
72 Graph graph = new Graph(8);

Callers 2

bfsMethod · 0.95
dfsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected