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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)的c語(yǔ)言算法(doc63)-經(jīng)營(yíng)管理(完整版)

  

【正文】 pe *h,int i,elemtype x) /*單鏈表 head 中第 i 個(gè)節(jié)點(diǎn) (i=0)之后插入一個(gè) data 域?yàn)?x 的節(jié)點(diǎn) */ { nodetype *p,*s。 } nodetype find(nodetype *h,int i)/*返回第 i 個(gè)節(jié)點(diǎn)的指針 */ { nodetype *p=h。 while (p!=NULL) { printf(%d ,pdata)。snext=NULL。d)。 struct linknode *next。 na=create(A)。jna。 while(inaamp。 int na,nb,nc。amp。 } } void main() { sqlist A。 getch()。 n=create(A)。 return 0。 break。/*ab*/ if(A[i]B[j]) return 1。amp。 while(inaamp。 disp(A,n)。/*查找插入位置 i*/ for(j=n。A[i]!=x) i++。 else { for(j=i1。 else { for(j=n1。 printf(輸出一個(gè)順序表 : \n)。n)。c)。 } main() {int a,b,c。*x=*y。*y=t。 scanf(%d,%d,%d,amp。 printf(%d %d %d,a,b,c)。 for(i=0。 if(n==0) printf(空表 )。j=i。jn。 if(in) return 1。j=i。 n=insert(A,n,10)。amp。j==nb) return 0。 else return 1。 case 1:printf(AB\n)。 } else { for(j=i+k1。 disp(A,n)。 } /*運(yùn)行結(jié)果: 創(chuàng)建一個(gè)順序表 輸入元素個(gè)數(shù): 5 輸入第 1 個(gè)元素值: 1 輸入第 1 個(gè)元素值: 2 輸入第 1 個(gè)元素值: 3 輸入第 1 個(gè)元素值: 4 輸入第 1 個(gè)元素值: 5 輸出一個(gè)順序表 1 2 3 4 5 輸入 I,k:2 2 輸出一個(gè)順序表 1 4 5 */ 練習(xí) /*試寫(xiě)一算法 ,實(shí)現(xiàn)順序表的就地逆置 ,即利用原表的存儲(chǔ)空間將線性表 (a1,a2,...,an)逆置為 (an,an1,...,a1).*/ include 7 void invert(sqlist A,int n) { int m=n/2,i。 int n。j=0) if(A[i1]B[j1]) i。 na=create(A)。amp。j++) C[k++]=A[j]。 disp(A,na)。 }nodetype。 if(d==0) break。tnext=s。 p=pnext。 int j=1。 s=(nodetype *)malloc(sizeof(nodetype))。 } else printf(輸入的 i值不正確 \n)。amp。 if(pb=NULL)/*只有一個(gè)節(jié)點(diǎn)的情況 */ free(pa)。 } else { p=h。 return h。注意:?jiǎn)捂湵淼拈L(zhǎng)度值 m和 n均未顯示存儲(chǔ) */ include nodetype *bine(nodetype *ha,nodetype *hb) { nodetype *hc=ha,*pa=ha,*pb=hb,*q,*r。 pb=r。 h3=(nodetype *)malloc(sizeof(nodetype))。pc=pb。/*h2 單鏈表還有節(jié)點(diǎn)時(shí) */ pc=h3。 disp(head2)。 add1=(long)p1。 scanf(%d,amp。r=NULL。 if(h==NULL) printf(空表 \n)。 int i。 typedef struct sqstack { elemtype data[MaxLen]。 return 1。 } int gettop(stack *st,elemtype *x)/*獲取棧頂元素 */ { if(sttop==0) { printf(棧下溢出 \n)。 printf(\n)。\039。 case39。{39。:if(!(pop(amp。 case39。)) ok=0。x==39。ok) return 1。 getch()。 amp。 amp。) { exp[t]=ch。)/*判斷為左括號(hào) */ { top++。t++。 st[top]!=39。*39。top。\039。039。 }while((ch=exp[t++])!=39。break。break。 return 1。 else { printf(波蘭表達(dá)式 : %d\n,exp)。 23 else return f1(m1,f1(m,n1))。/*初值 m 進(jìn)棧 */ st[top][3]=n。 st[top][2]=st[top1][2]1。st[top1][0]==2) { st[top1][1]=st[top][1]。 top。 }while(top=1)。 printf(feidigui c(%d,%d)=%d\n,m,n,f2(m,n))。/*隊(duì)列長(zhǎng)度增 1*/ return 1。 queue qu。)。 printf(%c\n,x)。)。)。 26 printf(%c\n,x)。試寫(xiě)一個(gè)算法判別讀入的一個(gè)以‘ ’為結(jié)束符的字符序列是否是 回文 .*/ include include define MaxLen 100 typedef struct node { char data。 pdata=s[i]。 } int judge(ode *h) 27 { char st[MaxLen]。 if(pdata==st[top]) p=pnext。 h=create(str)。 } 第四章 串 實(shí)現(xiàn)串基本運(yùn)算的頭文件 為 : include include define MaxLen 20 typedef strcut { char ch[MaxLen]。is1len。 else { for(i=pos1。 if(slen+tlenMaxLen) return 0。 } int ins(strtype *s,strtype *t,int i)/*插入一個(gè)子串 */ { int j。 slen=slen+tlen。 slen=slenn。 if(i+j1=s1len) { for(n=0。n++,k++) /*連接 s1 的位置 i及之后的字符 */ [n]=s1ch[k]。 } void main() { strtype s,s1,s2,s3,s4,s5,s6。/*s1=**/ s2=subs(amp。s4,6,1,amp。 }練習(xí) include include int index(strtype *s1,strtype *s2) { int i=0,j,k。 s1ch[k]==s2ch[j]) 31 { k++。 n=index(s1,s2)。 create(amp。s2)。,39。 while(s[i]amp。)39。k) { hstr[j]=s[i]。 while(s[i]) { rstr[r]=s[i]。 int len。/*建立一個(gè)新節(jié)點(diǎn) */ ghtag=1。 do { disastr(subs,hstr)。 } }while(len0)。amp。!ptag)/*為原子之后繼節(jié)點(diǎn)的情況 */ { printf(%d,p)。 } int locate(gnode *p,char x)/*判斷 x 是否在廣義表中 */ { int find=0。 } 練習(xí) /*復(fù)制廣義表 */ include void gcope(gnode *p,gnode *q) { 35 if(p=NULL)。 char str[MaxLen]。 disp(q)。 else if(ptag==1amp。 if(p!=NULLamp。 printf(廣義表 g1: )。 printf(\n)。 if(p==NULL) q=NULL。/*產(chǎn)生表尾的逆置廣義表 t*/ b=(gnode *)malloc(sizeof(gnode))。/*連接 */ } else/*plink=NULL*/ { q=(gnode *)malloc(sizeof(gnode))。 printf(\n)。 if(p==NULL) q=NULL。 if(p!=NULL) { delall(p,x,t)。 /*創(chuàng)建整個(gè)新表的表頭節(jié)點(diǎn) q*/ qtag=1。/*復(fù)制到原子節(jié)點(diǎn) */ qtag=0。 printf(由 g1 逆置為 g2\n)。 qlink=NULL。 blink=NULL。/*復(fù)制該原子節(jié)點(diǎn) */ stag=0。 printf((same(g1,g2)==0)?不同 : 相同 )。 printf(\n)。q==NULL) flag=1。qtag==1) flag=same(p,q)。 } 練習(xí) /*判別廣義表是否相等的遞歸算法 */ include int same(gnode *p,gnode *q) { int flag=1。 scanf(%s,str)。 else { q=(gnode *)malloc(sizeof(gnode))。amp。 } else/*為子表的情況 */ { if(!p) printf(())。amp。 } return(gh)。 p=r。 s++。 if(!strcmp(s,()))/*空表的情況 */ gh=NULL。i++。j++。 if(s[i]!=39。(s[i]!=39。,39。/*只取 0(原子節(jié)點(diǎn))或 1(表節(jié)點(diǎn)) */ struct node *link。 printf(子串 : )。 n=index(s1,s2)。 } if(j==s2len)/*s2 中止時(shí)找到了子串 */ break。 if(s1ch[i]==s2ch[j]) { k=i+1。 s6=replace(amp。/*s2=y*/ s3=subs(amp。s, (xyz)+*)。 []=39。n++)/*把 s1 的前 i1 個(gè)字符賦給 s*/ [n]=s1ch[n]。\039。\039。 for(j=slen1。itlen。i++) [ipos+1]=sch[i]。 s2len=s1len。 }strtype。%s39。 } if(p==NULL) return 1。 ode *p=h。 if(i==0) { h=p。 }ode。 while(len0) { dequeue(qu,amp。 enqueue(qu,39。 dequeue(qu,amp。 enqueue(qu,39。 enqueue(qu,39。 enqueue(qu,39。 if(len==0)/*隊(duì)列為空時(shí)下溢出 */ return 0。 } /*輸入: 3 8 回車(chē) digui c(3,8)=2045 feidigui c(3,8)=2045*/ 練習(xí) /*假設(shè)以帶頭結(jié)點(diǎn)的循環(huán)鏈表表示隊(duì)列,并且只設(shè)一個(gè)指針指向隊(duì)尾結(jié)點(diǎn)(注意 不設(shè)頭指針),試編寫(xiě)相應(yīng)的隊(duì) 列初始化、入隊(duì)列和出隊(duì)列的算法 */ include define MaxSize 6 typedef
點(diǎn)擊復(fù)制文檔內(nèi)容
醫(yī)療健康相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1