You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
z[s] = 1; e[x] = 0; q.push(x); while (!q.empty()) { int s = q.front(); q.pop(); // process node s for (auto u : v[s]) { if (z[u]) continue; z[u] = 1; e[u] = e[s]+1; q.push(u); } }
The BFS code on page 118 uses wrong variable - z[s] = 1; should be changed to z[x] = 1;
The text was updated successfully, but these errors were encountered:
z[s] = 1; e[x] = 0; q.push(x); while (!q.empty()) { int s = q.front(); q.pop(); // process node s for (auto u : v[s]) { if (z[u]) continue; z[u] = 1; e[u] = e[s]+1; q.push(u); } }
The BFS code on page 118 uses wrong variable -
z[s] = 1;
should be changed toz[x] = 1;
The text was updated successfully, but these errors were encountered: