Biconnected components & Articulation points
#include<stdio.h> #include<stdlib.h> #define max 20 typedef struct { int u,v; }edge; int dfn[max],l[max],num=1,n; int a[max][max]; edge stack[max]; int top=-1; void push(edge e) { if(top==max-1) printf("Stack is full"); else stack[++top]=e; } edge pop() { edge e; if(top==-1) printf("stack is empty"); else e=stack[top--]; return e; } void bicomp(int u,int v) { int w; edge e; dfn[u]=num;l[u]=num;num++; for(w=1;w<=n;w++) if(a[u][w]==1) { if((v!=w) && (dfn[w]<dfn[u])) { e.u=u; e.v=w; printf("\nEdge %d -- %d is pushed to stack",e.u,e.v); push(e); } if(dfn[w]==0) { bicomp(w,u); ...