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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)與算法(線性表)練習題-資料下載頁

2025-03-25 03:00本頁面
  

【正文】 t。 p=pnext。 } coutendl。}int main(){ DLIST DL=new celltype。// MakeNull(DL)。// Output(DL)。 Input(DL,5)。 Output(DL)。 Swap(2,DL)。 Output(DL)。}數(shù)據(jù)結(jié)構(gòu)十三includeiostreamusing namespace std。define maxsize 100typedef int Elementtype。struct LIST{ Elementtype element[maxsize][3]。 int count。}。void Convert(LIST amp。L,int a[10][10]){ int index=0。 for(int i=0。i10。i++) { for(int j=0。j10。j++) { if(a[i][j]!=0) { [index][0]=i。 [index][1]=j。 [index][2]=a[i][j]。 index++。 } } } =index+1。}int sum_diagonal(LIST amp。L){ int sum=0。 for(int i=0。i。i++) { if([i][0]==[i][1]) sum+=[i][2]。 } return sum。}void Output(LIST amp。L){ for(int i=0。i。i++) { cout[i][0]\t[i][1]\t[i][2]endl。 }}int main(){ LIST L。 int a[10][10]。 cout請輸入10X10的矩陣endl。 for(int i=0。i10。i++) { for(int j=0。j10。j++) { cina[i][j]。 } } Convert(L,a)。 Output(L)。 cout sum_diagonal(L) endl。}數(shù)據(jù)結(jié)構(gòu)十四 有點問題includeiostreamusing namespace std。define maxsize 100typedef int Elementtype。struct celltype{ Elementtype element。 int row。 int col。 celltype *next。}。typedef celltype *LIST。typedef celltype *position。void Insert(int r,int c,Elementtype x,position p){ position q=new celltype。 qelement=x。 qrow=r。 qcol=c。 qnext=pnext。 pnext=q。}void Add(int *a[][3],int *b[][3],LIST amp。L){ position p=L。 int a1=sizeof(*a)/sizeof(int)/3。 int b1=sizeof(*b)/sizeof(int)/3。 int i=0,j=0。 while(ia1||jb1) { if(i=a1amp。amp。jb1) { Insert(*b[j][0],*b[j][1],*b[j][2],p)。 j++。 p=pnext。 } if(ia1amp。amp。j=b1) { Insert(*a[i][0],*a[i][1],*a[i][2],p)。 i++。 p=pnext。 } else if(ia1amp。amp。jb1) { if(a[i][0]b[j][0]) { Insert(*a[i][0],*a[i][1],*a[i][2],p)。 i++。 p=pnext。 } else if(a[i][0]b[j][0]) { Insert(*b[j][0],*b[j][1],*b[j][2],p)。 j++。 p=pnext。 } else { if(a[i][1]b[j][1]) { Insert(*a[i][0],*a[i][1],*a[i][2],p)。 i++。 p=pnext。 } else if(a[i][1]b[j][1]) { Insert(*b[j][0],*b[j][1],*b[j][2],p)。 j++。 p=pnext。 } else { Insert(*a[i][0],*a[i][1],*b[j][2]+*a[i][2],p)。 i++。 j++。 p=pnext。 } } } }}void Output(LIST amp。L){ position p=L。 while(pnext!=NULL) { coutpnextrow\tpnextcol\tpnextelement\tendl。 p=pnext。 }}int main(){ LIST L =new celltype。 position p=L。 pnext=new celltype。 int a[][3] = {0,2,4, 0,4,6, 1,6,7, 1,7,9, 2,0,3, 2,5,4, 2,7,12, 3,2,7, 3,4,6, 4,2,13, 4,6,2, 4,7,14, 5,0,9, 5,4,15, 5,7,11}。 int b[][3] = {0,5,7, 1,2,9, 1,5,8, 2,4,6, 3,2,12, 3,5,11, 4,2,9, 5,7,11}。// for(int i=0。i9。i++)// {// Insert(i,i,i,p)。// } Add(a, b, L)。 Output(L)。 }數(shù)據(jù)結(jié)構(gòu)十五1. 121111110141113316112081335 14174521536數(shù)據(jù)結(jié)構(gòu)十六ttt^LSf^^f^^fat^fbfcfd^數(shù)據(jù)結(jié)構(gòu)十七includeiostream using namespace std。struct listnode{ listnode *link。 bool tag。 union{ char data。 listnode *dlink。 }element。}。typedef listnode *listpointer。bool Equal(listpointer S,listpointer T)//判斷廣義表是否相同 { bool x,y。 y=false。 if((S==NULL)amp。amp。(T==NULL)) y=true。 else if((S!=NULL)amp。amp。(T!=NULL)) { if(Stag==Ttag) { if(Stag==false) { if(S==T) x=true。 else x=false。 } else x=Equal(S,T)。 if(x==true) y=Equal(Slink,Tlink)。 } } return y。}listpointer Cal(listpointer L)//獲得表頭 { if (L==NULL) return NULL。 else return L。}listpointer Cdr(listpointer L)//獲得表尾 { if (L == NULL) return NULL。 else return Llink。}int elements(listpointer L)//求廣義表原子個數(shù) { if(L==NULL) return 0。 else { if(Ltag==false) return elements(Cdr(L))+1。 else return elements(Cdr(L))。 }}int main(){ listpointer L = new listnode。 listnode *p1 = new listnode, *p2 = new listnode, *p3 = new listnode。 Ltag = false。 L = 39。a39。 Llink = p1。 p1tag = false。 p1 = 39。b39。 p1link = p2。 p2tag = false。 p2 = 39。c39。 p2link = p3。 p3tag = false。 p3 = 39。d39。 p3link = NULL。 cout elements(L) endl。 return 0。}
點擊復制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1