循环队列sq中,用数组elem存放数据元素,sq.front指示队头元素的前一个位置,sq.rear指示队尾元素的当前位置,队列的最大容量为MAXSIZE,则队列满的条件为()。
A、A.sq.front= sq.rear
B、B.sq.front= sq.rear+1
C、C.(sq.front +1)mod MAXSIZE= sq.rear
D、D.(sq.rear+1)mod MAXSIZE= sq.front
A、A.sq.front= sq.rear
B、B.sq.front= sq.rear+1
C、C.(sq.front +1)mod MAXSIZE= sq.rear
D、D.(sq.rear+1)mod MAXSIZE= sq.front
A、sq.rear= (sq.rear+1)mod MAXSIZE; sq.elem[sq.rear]=x; B、sq.elem[sq.rear]=x; sq.rear= (sq.rear+1)mod MAXSIZE; C、sq.front= (sq.front+1)mod MAXSIZE; sq.elem[sq.front]=x; D、sq.elem[sq.front]=x; sq.front= sq.front+1;
A、s.elem[top]=e;s.top=s.top+1; B、s.elem[top+1]=e;s.top=s.top+1; C、s.top=s.top+1;s.elem[top+1]=e; D、s.top=s.top+1;s.elem[top]=e;
A、FOR j=n DOWNTO i DO elem[j]=elem[j+1]; elem[i]=e; B、FOR j=i TO n DO elem[j]=elem[j+1]; elem[i]=e; C、FOR j=i TO n DO elem[j+1]=elem[j]; elem[i]=e; D、FOR j=n DOWNTO i DO elem[j+1]=elem[j]; elem[i]=e;