用数组A[0..N-1]存放循环队列的元素值,若其头尾指针分别为front和rear,则循环队列中当前元素的个数为( )
A: (rear-front+mod m
B: (rear-front+1)mod m
C: (rear-front-1+mod m
D: (rear-fronmod m
A: (rear-front+mod m
B: (rear-front+1)mod m
C: (rear-front-1+mod m
D: (rear-fronmod m
举一反三
- 循环队列用数组A[0..m-1]存放其元素值,已知其头尾指针分别为front和rear,则当前元素个数为( )。 A: (rear—front+m)MOD m B: rear—front+1 C: rear—front—1 D: rear—front
- 用数组A[0…m-1]存放循环队列的元素值,若其头尾指针分别为front和rear,则循环队列中当前元素的个数为______。 A: (rear-front+m) mod m B: (rear-front+m+1) mod m C: (rear-front+m-1) mod m D: (rear-front-m-1) mod m
- 用数组A存放循环队列的元素值,若其头指针为front,尾指针为rear,则循环队列中当前元素的个数为: A: (rear-front+m)mod m B: (rear-front+1)mod m C: (rear-front-1+m)mod m D: (rear-front)mod m
- 用数组A[0,N-1]存放循环队列的元素值,若其头指针和尾指针分别为front和rear, 则循环队列中当前元素的个数为 A: (rear-front+N+1)mod N B: (rear-front+1)mod N C: (rear-front-1+mod N D: (rear-fronmod N
- 用数组A[m]存放循环队列的元素值,若其头尾指针分别为front和rear,则循环队列中当前元素的个数为()。 A: (rear+front)%m B: (rear-front+m)%m C: (rear-front)%m D: (rear-front+1)%m