rear = rear+1
rear = (rear+1)%m
front = (front+1)%m
rear = (rear+1)%m + 1
第1题:
第2题:
设数组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);
第3题:
●设数组data[m]作为循环队列SQ的存储空间,front为队头指针,rear为队尾指针,则执行出队操作后其头指针front值为 (41) 。
(41) A.front=front+1
B.front=(front+1)%(m-1)
C.front=(front-1)%m
D.front=(front+1)%m
第4题:
设数组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);
第5题:
:Afront=front+1
Bfront=(front+1)% m
Crear=(rear+1)%m
Dfront=(front+1)%(m+1)
第6题:
第7题:
设某循环队列的容量为50,头指针front=5(指向队头元素的前一位置),尾指针rear=9(指向队尾元素),则该循环队列中共有______个元素。
第8题:
A、front=(front+1)%m
B、front=(front-1)%m
C、front=front+1
D、front=(front+1)%(m-1)
第9题:
设数组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);
第10题:
设数组data[0…m]作为循环队列SQ的存储空间,front为队头指针,rear为队尾指针,则执行出队操作的语句为______。
A.front:=front+1
B.front:=(front+1)mod m
C.rear:=(rear+1)mod m
D.front:=(front+1)mod(m+1)