版本比较
提高组算法整理
正文
增加 43 行删除 0 行
119 行未改动全部展开120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171500 行未改动全部展开119 行未改动全部展开 }}```
#### 无向图
边双,可以缩点成森林
```cppvoid tarjan(int u,int from){ dfn[u]=low[u]=++now; st[++top]=u; for(int i=h[u];i;i=ne[i]){ int v=e[i]; if(!dfn[v])tarjan(v,i),chkmin(low[u],low[v]); else if(i!=(from^1))chkmin(low[u],dfn[v]); } if(dfn[u]==low[u]){ be[u]=++cnt;inst[u]=0; while(st[top]!=u)be[st[top--]]=cnt;--top; }}```
点双
```cppvoid tarjan(int u,int dad){ int son=0; dfn[u]=low[u]=++now; st[++top]=u; for(int i=h[u];i;i=ne[i]){ int v=e[i]; if(!dfn[v]){ tarjan(v,u);++son; if(low[v]>=dfn[u]){ vdcc[++cnt].push_back(v);vdcc[cnt].push_back(u); while(st[top]!=v)vdcc[cnt].push_back(st[top--]);--top; } chkmin(low[u],low[v]); } else if(v!=dad)chkmin(low[u],dfn[v]); } if(!son&&!dad)vdcc[++cnt].push_back(u);}```
### 欧拉回路
一笔画问题
500 行未改动全部展开