File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ int query(int u, int v) {
142142 query implementation
143143 * /
144144
145- // make depth[u] is always larger than or equal depth[u];
145+ // make depth[u] is always larger than or equal to depth[u];
146146 if (depth[u] < depth[v])
147147 swap(u, v)
148148
@@ -151,13 +151,13 @@ int query(int u, int v) {
151151 if (par[u][i] != -1 && depth[par[u][i]] >= h[v])
152152 u = par[u][i];
153153
154- // if one of given node is parent of the other or given sane nodes u, v;
154+ // if one of given node is parent of the other or given the same nodes u, v;
155155 // return one of them.
156156 if (u == v)
157157 return u;
158158
159- // make par[u][0] and par[v][0] target same node
160- for (int i = MAXLOG -1; i >= 0; --i)
159+ // make par[u][0] and par[v][0] target the same node
160+ for (int i = MAXLOG - 1; i >= 0; --i)
161161 if (par[u][i] != par[v][i])
162162 v = par[v][i], u = par[u][i];
163163
You can’t perform that action at this time.
0 commit comments