freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

算法與數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì)報(bào)告-在線瀏覽

2024-09-14 04:53本頁(yè)面
  

【正文】 include include define ERROR 0 define OK 1 define INFINITY INT_MAX define MAX_VERTEX_NUM 21 define STACK_INIT_SIZE 100 define STACKINCREAMENT 10 typedef enum{DG,DN,UDG,UDN}GraphKind。 //infotype *info。 typedef struct{ char vexs[MAX_VERTEX_NUM]。 int vexnum,arum。 }MGraph。 int quan。 }ArcNode,*AList。 AList firstarc。 typedef struct{ AdjList vertices。 GraphKind kind。 //鄰接表 typedef struct QNode{ char data。 }QNode,*QueuePre。 QueuePre rear。 //隊(duì)列 typedef struct { int *base。 int stacksize。 //棧 typedef struct { char adjvex。 }closedges[MAX_VERTEX_NUM]。 int visited[MAX_VERTEX_NUM]。 //頂點(diǎn)入度記錄數(shù)組 int ve[MAX_VERTEX_NUM]。G,int option){ switch(option){ case 1: =DG。 case 2: =DN。 case 3: =UDG。 case 4: =UDN。 default: return ERROR。 } //鄰接矩陣類型設(shè)置 int SetGraphKind(ALGraph amp。break。break。break。break。 } return OK。 for(m=1。m++){ if(G.vexs[m]==v) return m。 } //鄰接矩陣頂點(diǎn)定位 int LocateVex(ALGraph G,char v){ int m。m=G.vexnum。 } printf(您輸入的頂點(diǎn)不存在)。 } //鄰接表頂點(diǎn)定位 int InitQueue(LinkQueue amp。 if(!) return ERROR。 return OK。Q,int e){ QueuePre p。 if(!p) return OK。pnext=NULL。 =p。 } //元素入隊(duì)列 int DeQueue(LinkQueue amp。e){ QueuePre p。 p=next。 next=pnext。 free(p)。 } //元素出隊(duì)列 int QueueEmpty(LinkQueue Q){ if(==) return OK。 } //判斷隊(duì)列是否為空 int InitStack(SqStack amp。 if(!) return ERROR。 =STACK_INIT_SIZE。 } //棧創(chuàng)建 int Push(SqStack amp。 if(!) return ERROR。 +=STACKINCREAMENT。 return OK。S,int amp。 e=*。 } //元素出棧 int StackEmpty(SqStack S){ if(==) return OK。 } //判斷棧是否為空 int CreatGraph(MGraph amp。char x,y。return ERROR。 scanf(%d %d,amp。G.arum)。 return ERROR。 for(i=1。++i) {fflush(stdin)。G.vexs[i])。i=G.vexnum。j=G.vexnum。 if(G.kind==DG){ printf(請(qǐng)輸入有向圖的兩個(gè)相鄰的頂點(diǎn)x,y(如果互相鄰接則x,y也要輸入):\n)。k=。 scanf(%c%c,amp。y)。j=LocateVex(G,y)。 } } else{ printf(請(qǐng)輸入無(wú)向圖的兩個(gè)相鄰的頂點(diǎn)(x,y):\n)。k=G.arum。 scanf(%c%c,amp。y)。 j=LocateVex(G,y)。 G.arcs[j][i].adj=G.arcs[i][j].adj。i=G.vexnum。j=G.vexnum。 if(G.kind==DN){ printf(請(qǐng)輸入有向網(wǎng)的兩個(gè)相鄰的頂點(diǎn)x,y以及相應(yīng)的權(quán)值w(如果互相鄰接則y,x也要輸入):\n)。k=G.arum。 scanf(%c%c %d,amp。y,amp。 i=LocateVex(G,x)。 G.arcs[i][j].adj=w。 for(k=1。k++){fflush(stdin)。x,amp。w)。 j=LocateVex(G,y)。 G.arcs[j][i].adj=G.arcs[i][j].adj。 } //創(chuàng)建鄰接矩陣 int CreatAList(ALGraph amp。 char x,y,w。 SetGraphKind(G,option)。 scanf(%d %d,amp。G.arum)。return ERROR。 for(i=1。i++){ fflush(stdin)。[i].data)。 key[i]=0。 for(j=1。j++){ fflush(stdin)。x,amp。 m=LocateVex(G,x)。 p=G.vertices[m].firstarc。 if(!q) return ERROR。 qadjvex=n。amp。 key[m]++。key[m]++。 } } if(G.kind==UDG){ printf(請(qǐng)輸入?。ㄈ鏏B,其中AB與BA是不同的弧):\n)。j=2*G.arum。 scanf(%c%c,amp。y)。 n=LocateVex(G,y)。 q=(AList)ma
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1