图---删除指定弧(邻接表)
typedef struct arcnode //边节点 { int adjvex; struct arcnode* nextarc; int weight; }arcnode; typedef struct vnode //顶点节点 { int data; arcnode* firstarc; }vnode, adjlist[100];//邻接表 typedef struct Graph //图结构 { adjlist ver; int vernum, arcnum; }Graph; void Delete(adjlist g, int i, int j) { arcnode *p,*pre; p = g[i].firstarc; pre = NULL; while (p) { if (p->adjvex == j)//找到弧 { if (pre == null)//此节点第一条弧 { g[i].firstarc = p->nextarc; } else//删除操作 { pre->nextarc = p->nextarc; free(p); } } else//未找到,继续搜索 { pre = p; p = p->nextarc; } } p = g[j].firstarc;//无向图搜索两个方向 pre = NULL; while (p) { if (p->adjvex ==