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

正文內(nèi)容

中南大學(xué)數(shù)據(jù)結(jié)構(gòu)實驗報告-展示頁

2024-11-09 12:58本頁面
  

【正文】 printf(“t請選擇:”)。printf(“”)。case 4:SqQueue Sv。break。break。x)。while(x){EnQueue(Q,x)。scanf(“%d”,amp。結(jié)束n”)。case 2:printf(“t以39。printf(“t鏈?zhǔn)酱鎯﹃牭某跏蓟瓿?n”)。n)。while(1){printf(“t請選擇:”)。printf(“”)。case 3:LinkQueue Q。break。case 3:Popa(S)。printa(S)。x)。while(x){Pusha(S,x)。scanf(“%d”,amp。結(jié)束n”)。case 2:printf(“t以39。printf(“t順序存儲棧的初始化完成!n”)。n)。while(1){printf(“t請選擇:”)。printf(“”)。case 2:SqStack S。break。break。x)。while(x){Pushb(Sa,x)。scanf(“%d”,amp。結(jié)束n”)。case 2:printf(“t以39。printf(“t鏈?zhǔn)酱鎯5某跏蓟瓿?n”)。n)。while(1){printf(“t請選擇:”)。printf(“”)。switch(choice){case 1:Stack Sa。scanf(“%d”,amp。printf(“、入隊、出隊操作n”)。printf(“、入棧、出棧操作n”)。printf(“nn”)。} void main(){int choice。=(+1)%MAX。if(==)return。} void DeQueueb(SqQueue amp。[]=x。} void EnQueueb(SqQueue amp。==0。=(SElemType *)malloc(MAX*sizeof(SElemType))。}SqQueue。}typedef struct {SElemType *base。free(p)。next=pnext。x=pdata。QueuePtr p。Q)//鏈?zhǔn)酱鎯崿F(xiàn)隊列的出隊 {int x。=p。pnext=NULL。if(!p)exit(OVERFLOW)。Q,QElemType x)//鏈?zhǔn)酱鎯崿F(xiàn)隊列的入隊 {QueuePtr p。return(Q)。if(!)exit(OVERFLOW)。LinkQueue InitQueue()//鏈?zhǔn)酱鎯崿F(xiàn)隊列的初始化 {LinkQueue Q。QueuePtr rear。}*QueuePtr,QNode。} }typedef struct QNode {QElemType data。printf(“t刪除的棧頂元素是%dn”,x)。x=pdata。if(Link==NULL)return。S)//鏈?zhǔn)酱鎯崿F(xiàn)棧的出棧操作 {int x。Link=p。pdata=x。p=(Sqptr)malloc(sizeof(NODE))。}void Pushb(Stack amp。Link=NULL。=(Sqptr)malloc(sizeof(NODE))。}Stack。}*Sqptr,NODE。}typedef struct SqNode {SElemType data。while(p!=){printf(“%d ”,*(p++))。p=。printf(“t刪除的棧頂元素是%dnt出棧操作完成后的棧為:n”,x)。else {p=。int x。}void Popa(SqStack amp。S,int x)//順序存儲實現(xiàn)棧的入棧操作 {if(=MAX)exit(OVERFLOW)。return(S)。if(!)exit(OVERFLOW)。SqStack InitStacka()//順序存儲實現(xiàn)棧的初始化 {SqStack S。SElemType *top。typedef int QElemType。、入棧等基本操作。五、實驗步驟。++編程平臺。二、實驗內(nèi)容。運(yùn)行結(jié)果如下: 插入結(jié)果:14 13 12 94 93 刪除結(jié)果:20 14 13 12 94 93 運(yùn)行結(jié)果截圖:實驗二 棧和隊列的實現(xiàn)一、目的和要求。getch()。Ins(head,i,element)。i,amp。printf(“Input the insert posion and element:n”)。Del(head,i)。scanf(“%d”,amp。printf(“the element of the order is %dn”,element)。i)。printf(“input the order :n”)。length=Listlen(head)。head=Create()。int i,element。} } /******************************************/ main(){ NODE *head。qnext=pnext。else { q=(NODE *)malloc(sizeof(NODE))。amp。jnext。while(pnextamp。} /******************************************/ void Ins(NODE *head,int i,int e){ NODE *p=head,*q。} if(!pnext||ji1)printf(“the position is wrongn”)。amp。int j=0。else return(pdata)。jnext。while(pnextamp。} /******************************************/ int Get(NODE *head,int i){ int j=0。p=pnext。NODE *p=head。} printf(“nThe LinkList ended!n”)。while(pnext!=NULL){ printf(“%d”,pnextdata)。p=head。} return(head)。scanf(“%d”,amp。pnext=headnext。while(x!=1){ p=(NODE *)malloc(sizeof(NODE))。scanf(“%d”,amp。headnext=NULL。int x。} NODE。程序如下:include include include include typedef struct node { int data。三、實驗原理利用線性表的特性以及其鏈?zhǔn)酱鎯Y(jié)構(gòu)特點(diǎn)對線性表進(jìn)行相關(guān)操作。第一篇:中南大學(xué) 數(shù)據(jù)結(jié)構(gòu)實驗報告數(shù)據(jù)結(jié)構(gòu)實驗報告專業(yè)班級: 指導(dǎo)老師:余臘生 姓名: 學(xué)號: 實驗一 單鏈表的基本操作的實現(xiàn)一、實驗?zāi)康恼莆諉捂湵淼幕静僮鳎航ⅰ⒉迦?、刪除、查找等運(yùn)算。二、實驗儀器安裝VC++的PC機(jī)。四、實驗內(nèi)容程序中演示了單鏈表的創(chuàng)建、插入、刪除和查找。struct node *next。/******************************************/ NODE *Create(){ NODE *p,*head。head=(NODE *)malloc(sizeof(NODE))。printf(“Input data,1 to End!n”)。x)。pdata=x。headnext=p。x)。} /******************************************/ void Output(NODE *head){ NODE *p。printf(“Begin to dump the LinkList...n”)。p=pnext。} /******************************************/ int Listlen(NODE *head){ int i=0。while(pnext!=NULL){ i++。} return(i)。NODE *p=head。amp。} if(!pnext||ji)return(0)。} /******************************************/ void Del(NODE *head,int i){ NODE *p=head。while(pnextamp。jnext。else pnext=pnextnext。int j=0。amp。} if(!pnextamp。ji1)printf(“Wrong positionn”)。qdata=e。pnext=q。int length。system(“CLS”)。Output(head)。printf(“the length of the link is %dn”,length)。scanf(“%d”,amp。element=Get(head,i)。printf(“input the del position n”)。i)。Output(head)。scanf(“%d%d”,amp。element)。Output(head)。}五、數(shù)據(jù)記錄及處理運(yùn)行程序,輸入下面一組數(shù)據(jù): 93 94 12 13 20 14 鏈表順序:14 20 13 12 94 93刪除第二個數(shù)據(jù)結(jié)點(diǎn),在第一個位置插入數(shù)據(jù)20。通過本實驗,熟悉隊列、棧的結(jié)構(gòu)特點(diǎn); 、棧結(jié)構(gòu)上的操作與算法的實現(xiàn)。三、儀器、設(shè)備和材料。四、實驗原理隊列與棧是一種操作受限制的線性表,在了解線性表的基本原理的基礎(chǔ)上,理解與完成此項實驗。,出隊,入隊等基本操作。六、程序算法include include define OVERFLOW2 define ERROR 0 define OK 1 define MAX 100 //棧的最大值 typedef int SElemType。typedef struct {SElemType *base。}SqStack。=(SElemType *)malloc(MAX*sizeof(SElemType))。=。}void Pusha(SqStack amp。*++=x。S)//順序存儲實現(xiàn)棧的出棧操作 {SElemType *p。if(==)return。x=*。} } void printa(SqStack S)//輸出 {SElemType *p。printf(“t”)。} printf(“n”)。SqNode *Link。typedef struct {Sqptr top。Stack InitStackb()//鏈?zhǔn)酱鎯崿F(xiàn)棧的初始化 {Stack S。if(!)exit(OVERFLOW)。return(S)。S,int x)//鏈?zhǔn)酱鎯崿F(xiàn)棧的入棧操作 {Sqptr p。if(!p)return。pLink=Link。}void Popb(Stack amp。Sqptr p。else {p=Link。Link=pLink。free(p)。struct QNode *next。typedef struct {QueuePtr front。}LinkQueue。==(QueuePtr)malloc(sizeof(QNode))。next=NULL。} void EnQueue(LinkQueue amp。p=(QueuePtr)malloc(sizeof(QNode))。pdata=x。next=p。} void DeQueue(LinkQueue amp。if(==)return。p=next。printf(“t刪除的隊頭元素是:%dn”,x)。if(==p)=。return。int front,rear。SqQueue InitQueueb()//順序存儲實現(xiàn)隊列的初始化 {SqQueue S。if(!)exit(OVERFLOW)。return(S)。S,int x)//順序存儲實現(xiàn)隊列的入隊 {if((+1)%MAX==)return。=(+1)%MAX。S)//順序存儲實現(xiàn)隊列的出隊 {int x。x=[]。printf(“t刪除的隊頭元素是:%dn”,x)。int n,x。printf(“、入棧、出棧操作n”)。printf(“、入隊、出隊操作n”)。printf(“t請選擇:”)。choice)。printf(“”)。printf(“”)。scanf(“%d”,amp。switch(n){case 1:Sa=InitStackb()。break。039。printf(“t”)。x)。scanf(“%d”,amp。}printf(“t鏈?zhǔn)酱鎯5娜霔2僮魍瓿?n”)。case 3:Popb(Sa)。}}break。printf(“”)。printf(“”)。scanf(“%d”,amp。switch(n){ case 1:S=InitStacka()。break。039。printf(“t”)。x)。scanf(“%d”,amp。}printf(“t順序存儲棧的入棧操作完成!n”)。break。printa(S)。}}break。printf(“”)。printf(“”)。scanf(“%d”,amp。switch(n){case 1:Q=InitQueue()。break。039。printf(“t”)。x)。scanf(“%d”,amp。}printf(“t鏈?zhǔn)酱鎯﹃牭娜霔2僮魍瓿?n”)。case 3:DeQueue(Q)。}}break。printf(“”)。printf(“”)。scanf(“%d”,amp。switch(n){case 1:Sv=InitQueueb()。break。039。printf(“t”)。x)。scanf(“%d”,amp。}printf(“t鏈?zhǔn)酱鎯5娜霔2僮魍瓿?n”)。case 3: DeQueueb(Sv)。}}break。實驗三 二叉樹的
點(diǎn)擊復(fù)制文檔內(nèi)容
外語相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1