第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

數(shù)據(jù)結(jié)構(gòu)循環(huán)隊(duì)列的刪除問題

數(shù)據(jù)結(jié)構(gòu)循環(huán)隊(duì)列的刪除問題

#include<stdio.h>#include<stdlib.h>#define ERROR 0#define MAXQSIZE 100typedef int Status;typedef int QElemType;typedef struct{? ? int *base;? ? int front;? ? int rear;}SqQueue;Status InitQueue(SqQueue *Q){? ? Q->base=(QElemType*)malloc(MAXQSIZE*sizeof(QElemType));? ? if(!Q->base)? return ERROR;? ? Q->front=Q->rear=0;? ? return 0;}Status QueueLength(SqQueue *Q){? ? int length;? ? length=(Q->rear-Q->front+MAXQSIZE)%MAXQSIZE;? ? return length;}Status EnQueue(SqQueue *Q,QElemType e){? ? if((Q->rear+1)%MAXQSIZE==Q->front) return ERROR;? ? Q->base[(Q->rear+1)]=e;? ? Q->rear=(Q->rear+1)%MAXQSIZE;? ? return 0;}Status DeQueue(SqQueue *Q){? ? int e,test;? ? if(Q->front==Q->rear) return ERROR;? ? test=Q->front;? ? e=Q->base[Q->front];? ? Q->front=(Q->front+1) % MAXQSIZE;? ? return e;}void JudgeEmpty(SqQueue *Q){? ? if((Q->rear+1)%MAXQSIZE==Q->front) printf("The queue is full\n");? ? else? if(Q->rear==Q->front) printf("The queue is Empty\n");? ? else printf("The queue is not empty!\n");}/*?void DestroyQueue(SqQueue *Q)?{??}?*/int main(){? ? SqQueue Q;? ? int number,receive,i,transmission;? ? int length;? ? InitQueue(&Q);? ? printf("how many numbers do you want to enter:");? ? scanf("%d",&number);? ? for(i=1;i<=number;i++)? ? {? ? ? ? printf("The %d number:",i);? ? ? ? scanf("%d",&transmission);? ? ? ? EnQueue(&Q,transmission );? ? }? ? JudgeEmpty(&Q);? ? length=QueueLength(&Q);? ? printf("the length is %d\n",length);? ? receive=DeQueue(&Q);? ? printf("The first number is:%d",receive);? ? printf("\n");}出隊(duì)函數(shù)那個(gè)調(diào)試有問題,設(shè)置了一個(gè)test來檢驗(yàn),但是好像都不對,但是我覺得我沒敲錯(cuò)啊
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關(guān)注
  • 1063 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號