MCPcopy Create free account
hub / github.com/algorithmzuo/algorithm-journey / addEdge

Method addEdge

src/class161/Code07_FarAway1.java:48–52  ·  view source on GitHub ↗
(int u, int v)

Source from the content-addressed store, hash-verified

46 public static int[] change = new int[MAXN << 2];
47
48 public static void addEdge(int u, int v) {
49 next[++cntg] = head[u];
50 to[cntg] = v;
51 head[u] = cntg;
52 }
53
54 // 递归版,C++可以通过,java会爆栈
55 public static void dfs1(int u, int f) {

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected