(单选)假定一个顺序存储的循环队列Q,其队头和队尾指示器分别为front和rear,则判断队空的条件为() A. Q->front+1 == Q->rear B. Q->rear+1 == Q->front C. Q->front == 0 D. Q->front == Q->rear

(单选)假定一个顺序存储的循环队列Q,其队头和队尾指示器分别为front和rear,则判断队空的条件为() A. Q->front+1 == Q->rear B. Q->rear+1 == Q->front C. Q->front == 0 D. Q->front == Q->rear


参考答案和解析
front == rear

相关考题:

设数组data[0…m]作为循环队列sq的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为A.sq↑.front:=sq↑.front+1;B.sq↑.front:=(sq↑.front+1)%maxsize ;C.sq↑.rear:=(sq↑.rear+1)%maxsize ;D.sq↑.front:=(sq↑.front+1)%(maxsize+1);

循环队列Q的元素出队时的队头指针操作是() A、rear=(rear+1)%sizeB、rear=rear+1C、front=(front+1)%sizeD、front=(front-1)%size

判断一个循环队列Q(最多n个元素)为满的条件是()。 A、Q->rear==Q->frontB、Q->rear==Q->front+1C、Q->front==(Q->rear+1)%nD、Q->front==(Q->rear-1)%n

设数组Data[0..m]作为循环队列SQ的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为() :Afront=front+1Bfront=(front+1)% mCrear=(rear+1)%mDfront=(front+1)%(m+1)

设数组data[0…m]作为循环队列S q的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为( )。A.S q↑.front:=S q十.front+1;B.S q↑.front:=(S q十.front+1)%maxsize;C.S q↑.rear:=(s q十.rear+1)%maxsize;D.S q↑.front:=(s q十.front+1)%(maxsize+1);

在队列中,(7)允许插入操作,(7)允许删除操作。A.队头(front)队尾(rear)B.队尾(rear)队头(front)C.队头(front)和队尾(rear)队头(front)D.队头(front)和队尾(rear)队头(front)和队尾(rear)

阅读下列函数说明和C函数,将应填入(n)处的字句写在对应栏内。[说明]循环队列的类型定义如下(其中队列元素的数据类型为datatype):typedef struct{datatype data[MAXSIZE]; /*数据的存储区*/int front,rear; /*队首、队尾指针*/int num; /*队列中元素的个数*/}c _ SeQueue; /*循环队*/下面函数及其功能说明如下:(1) c_SeQueue* Init_SeQueue():新建队列;(2) int ln_SeQueue( c_SeQueue *q, datatype x):将元素x插入队列q,若成功返回1否则返回0;(3) int Out_SeQueue (c_SeQueue *q, datatype *x):取出队列q队首位置的元素,若成功返回1否则返回0。[函数]c_SeQueue* Init_SeQueue(){ q=malloc(sizeof(c_SeQueue));q->front=q->rear=MAXSIZE-1;(1);return q;}int In_SeQueue( c_SeQueue *q, datatype x){ if(q->num= =MAXSIZE) return 0; /*队满不能入队*/else {q->rear=(2);q->data[q->rear]=x;(3);return 1; /*入队完成*/}}int Out_SeQueue( c_SeQueue *q, datatype *x){ if (q->num= =0) return 0; /*队空不能出队*/else{*x=(4); /*读出队首元素*/q->front=(5);q->num- -;return 1; /*出队完成*/}}

设数组data[0…m]作为循环队列s q的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为( )。A.S q↑.front:=s q↑.front+1;B.S q↑.front:=(S q↑.front+1)%maxsize;C.S q↑.rear:=(S q↑.rear+1)%maxsize;D.S q↑.front:=(s q↑.front+1)%(maxsize+1);

设数组data[O…m]作为循环队列sq的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为A.sq↑.front:=sq↑.front+1;B.sq↑.front:=(sq↑.front+1)%maxsize;C.sq↑.rear:=(sq↑.rear+1)%maxsize;D.sq↑.front:=(sq↑.front+1)%(maxsize+1);

阅读下列函数说明和C函数,将应填入(n)处的字句写在对应栏内。[说明]链式存储的队列称为链队。根据队列的FIFO原则,为了操作上的方便,可以使用带头指针front和尾指针rear的单链表来实现链队。若链队元素的数据类型为datatype,则链队结构描述如下:typedef struct node{ datatypedata;structnode *next;} QNode; /*链队结点的类型*/typedef struct{ QNnode *front,*rear;} LQueue; /*将头尾指针封装在一起的链队*/以下这种链队的几个例子:设q是一个指向链队的指针,即LQueue *q。下面各函数的功能说明如下:(1) LQueue *Init_LQueue():创建并返回一个带头尾结点的空链队;(2) intEmpty_LQueue( LQueue *q):判断链队q是否空;(3) void In_LQueue(LQueue *q, datatypex):将数据x压入链队q;(4) int Out_LQueue(LQuere *q, datatype *x):弹出链队q的第一个元素x,若成功则返回返回1否则返回0。[函数]LQueae *Init_LQueue(){ LQueue *q, *p;q=malloc(sizeof(LQueue)); /*申请链队指针*/P=malloc(sized(QNode));/*申请头尾指针结点*/p->next=NULL;(1)=p;return q;}int Empty_LQueue(LQueue *q){ if(q->front (2) q>rear) return 0;else return 1;}void In_LQueue(LQueue *q, datatype x){ QNoda *p;p=malloc(sizeof(QNnode));/*申请新接点*/p->data=x;p->next=NULL;(3)=p;q->rear=p;}int Out_LQueue(LQueue *q, datatype *x){ QNnode *p;if(Empty_LQueue(q)) return 0; /*队空,操作失败*/else{p=q->front->next;*x=(4);(5)=p->next;free(p);if (q->front->next= =NULL)q->rear=q->front;return 1;}}

设数组data[0…m]作为循环队列SQ的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为______。A.front:=front+1B.front:=(front+1)mod mC.rear:=(rear+1)mod mD.front:=(front+1)mod(m+1)

设数组Data [0..m)作为循环队列SQ的存储空间,front 为队头指针,rear 为队尾指针,则执行出队操作的语句为(60)。A.front=(front+1)%(m+1)B.front=(front+1)%mC.rear=(rear+1)%mD.front=front+1

假定一个链队列的队首和队尾指针分别为front和rear,则判断队空的条件为( )。A.front==rearB.front!=NULLC.rear!=NULLD.front==NULL

C语言数组Data[m+1]作为循环队列SQ的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为( )A.front=front+1B.front=(front+1)%mC.rear=(rear+1)%mD.front=(front+1)%(m+1)

以数组Data[m+1]作为循环队列SQ的存储空间,front为头指针,rear为队尾指针,则执行出队操作的语句是()。A.front=front+1B.front=(front+1)%mC.front=(front+1)%(m+1)D.rear=(rear+1)%m

假定一个顺序循环队列的队首和队尾指针分别用front和rear表示,则判队空的条件是()A、front+1==rearB、front==rear+1C、front==0D、front==rear

若循环队列有 n个顺序存储单元,front、rear分别为队首和队尾元素的下标,front指向队首元素之前的一个位置,为则判断队满的条件是()。A、  front = =rearB、 (front-1)%n= =rearC、 (rear+1)%n= =frontD、 (rear-1)%n= = front

在具有n个单元的顺序存储的循环队列中,假定front和rear分别为队头指针和队尾指针,则判断队满的条件为()A、rear%n= = frontB、(front+l)%n= = rearC、rear%n -1= = frontD、(rear+l)%n= = front

假定一个顺序循环队列存储于数组a[n]中,其队首和队尾指针分别用front和rear表示,则判断队满的条件为()A、(rear - 1)% n == frontB、(rear + 1)% n == frontC、(front - 1)% n == rearD、(front + 1)% n == rear

设数组Data[m+1]作为循环队列sq的存储空间,front成为队头指针,rear为队尾指针,则执行入队操作的语句为()A、rear = rear+1B、rear = (rear+1)%mC、front = (front+1)%mD、rear = (rear+1)%m + 1

假定一个顺序循环队列存储于数组A[n]中,其队首和队尾指针分别用front和rear表示,则判断队满的条件是()A、(rear-1)%n==frontB、(rear+1)%n==frontC、rear==(front-1)%nD、rear==(front+1)%n

在具有n个单元的顺序存储的循环队列中,假定front和rear分别为队头指针和队尾指针,则判断队空的条件为()A、rear%n= = frontB、front+l= rearC、rear= = frontD、(rear+l)%n= front

若循环队列有 n个顺序存储单元,front、rear分别为队首和队尾元素的下标,front指向队首元素之前的一个位置,为则判断队空的条件是()。A、 front = =rearB、 (front-1)%n= =rearC、 (rear+1)%n= =frontD、 (rear-1)%n= = front

最大容量为n的循环队列,队尾指针是rear,队头是front,则队空的条件是()。A、(rear+1)%n==frontB、rear==frontC、rear+1==frontD、(rear-l)%n==front

循环队列的队头和队尾指针分别为front和rear,则判断循环队列为空的条件是()。A、front==rearB、front==0C、rear==0D、front=rear+1

单选题假定一个顺序循环队列存储于数组A[n]中,其队首和队尾指针分别用front和rear表示,则判断队满的条件是()A(rear-1)%n==frontB(rear+1)%n==frontCrear==(front-1)%nDrear==(front+1)%n

单选题若循环队列有 n个顺序存储单元,front、rear分别为队首和队尾元素的下标,front指向队首元素之前的一个位置,为则判断队空的条件是()。A front = =rearB (front-1)%n= =rearC (rear+1)%n= =frontD (rear-1)%n= = front

单选题若循环队列有 n个顺序存储单元,front、rear分别为队首和队尾元素的下标,front指向队首元素之前的一个位置,为则判断队满的条件是()。A  front = =rearB (front-1)%n= =rearC (rear+1)%n= =frontD (rear-1)%n= = front