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

Method dfs2

src/class194/Code08_Tourists1.java:138–152  ·  view source on GitHub ↗
(int u, int t)

Source from the content-addressed store, hash-verified

136 }
137
138 public static void dfs2(int u, int t) {
139 top[u] = t;
140 nid[u] = ++cnti;
141 val[nid[u]] = u <= n ? arr[u] : getMin(u);
142 if (son[u] == 0) {
143 return;
144 }
145 dfs2(son[u], t);
146 for (int e = head2[u], v; e > 0; e = next2[e]) {
147 v = to2[e];
148 if (v != fa[u] && v != son[u]) {
149 dfs2(v, v);
150 }
151 }
152 }
153
154 public static void up(int i) {
155 minv[i] = Math.min(minv[i << 1], minv[i << 1 | 1]);

Callers 1

mainMethod · 0.95

Calls 1

getMinMethod · 0.95

Tested by

no test coverage detected