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

正文內(nèi)容

數(shù)組與廣義表的算法的實驗報告(文件)

2025-08-09 04:28 上一頁面

下一頁面
 

【正文】 e(B)。 =0。arow++)//arow為當前A矩陣的行標 { for(i=0。//tp為arow+1行的首非零元在data【】中的序號 else //arow為最后一行 tp=+1。//brow為 與B矩陣中的相應行對應的 A中當前元素的列標 if(brow) t=[brow+1]。q++)//[]中的序號 { ccol=[q].j。ccol++)// if(temp[ccol])//temp【ccol】不為零,則把值賦到c中。 } } } }}void clear(juzhen amp。 =0。 for(i=0。 [i].e=0。 printf(請選擇:稀疏矩陣的加法,并輸出結果,稀疏矩陣乘法,并輸出結果\n)。 scanf(%d,amp。 printf(\n)。 printf(\n)。 printf(\n)。 printf(\n)。 }運行結果:(1) 稀疏矩陣加法 (2)稀疏矩陣乘法 (3)十字鏈表加法(4)十字鏈表乘法 廣義表的各種算法代碼:include include includedefine maxlen 100typedef char ElemType。 } val。 int top。 char ch。\039。) { htag=1。) h=NULL。 ch=*s。) htp=CreateGL(s)。 if (g==NULL) printf()。 if (gtp!=NULL) { printf(,)。 g=g。 } g=gtp。 if (g==NULL) { printf(空表不能求表尾\n)。 } p=ptp。 t=p。amp。 } }//求廣義表的逆表void NIGList(GList *g,SeqStack *s){ if(g!=NULL) { if (gtag==1) { stop++。 else NIGList(g,s)。 sdata[stop]=39。,39。 }}//以下主函數(shù)用于調試void main(){ GList *g,*gt。 int y=0,mark,xz=1。 ktop=1。 while(xz) { DispGL(g)。 printf(** **\n)。 printf(** **\n)。y)。 scanf(%c,amp。 else printf(T_T對不起,沒有找到該元素!\n)。DispGL(gt)。 break。 printf(\n)。 return 。 scanf(%d,amp。 printf(再見,歡迎再次使用!\n)。 if(xz==1) system(cls)。\n)。 default : system(cls)。 NIGList(g,k)。 break。 case 2: gt=tail(g)。 FindGListX(g,x,mark)。 mark=0。 printf(請 選 擇:(0~5)\n)。 printf(** **\n)。 printf(****廣義表的運算****\n)。 g=CreateGL(s)。 //調用系統(tǒng)命令,改變運行時的字體顏色 SeqStack *k。 char str[30]。 } }}//廣義表的輸出void Pop(SeqStack *s){ while(stop=0) { printf(%c,sdata[stop])。 } if (gtp!=NULL) { stop++。 sdata[stop]=g。)39。 } else if(gtag == 1) FindGListX(g,x,mark)。}//查找函數(shù)void FindGListX(GList *g,char x,int amp。 ttag=1。 } else if (gtag==0) { printf(原子不能求表尾\n)。}//求廣義表的表尾GList *tail(GList *g) { GList *p=g。 while (g!=NULL) { if (gtag==1) { dep=GLDepth(g)。 } }}//求廣義表的深度int GLDepth(GList *g) { int max=0,dep。 } else printf(%c, g)。 return h。 if (h!=NULL) if (ch==39。 h=ch。 } else if (ch==39。 if (ch==39。 s++。//生成廣義表 GList *CreateGL(char *amp。 } GList。 union { ElemType atom。 case 5: break。 case 4: multycross(b)。 case 3: a=addcross()。 case 2: multy(A,B,C)。 switch(x) { case 1: add(A,B,C)。 printf(******************************************************************\n)。 crosslist a,b,c,d。i++) { [i].i=0。iSize1+1。 =0。 [].i=arow。//temp【ccol】:相乘所得的C矩陣中第arow行cool列元素的值 } } for(ccol=1。 for(q=[brow]。ptp。i++)//初始化temp temp[i]=0。 else // { for(arow=1。 else { =。//各變量代表含義見下面 printf(稀疏矩陣乘法:\n)。 } printf(\n)。j++) { if([k].i==iamp。 else for(i=1。 } }void print(juzhen A)//輸出稀疏矩陣{ printf(\n矩陣為:\n)。 while(k2=)//A中非零元已用完,B中還有非零元 [k++]=[k2++]。 k++。 temp=[k1].e+[k2].e。 else if([k1].i[k2].i)//同上 [k++]=[k2++]。 if(!=||!=) printf(格式不對,不能相加!\n)。 C)//稀疏矩陣加法{ int k=1,temp=0,k1=1, k2=1。 while([t].i=iamp。i++)//初始化rops【】 [i]=0。[i].j,amp。 for(i=1。,amp。 }
點擊復制文檔內(nèi)容
外語相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1