已知循环队列Q-> element[MAXSIZE],队头指示器为Q->front,队尾指示器为Q->rear(指向真实队尾的下一个位置),则该队列中元素个数为:()
A: Q->rear-Q->front
B: Q->rear-Q->front+1
C: (Q->rear-Q->front+ MAXSIZE)% MAXSIZE
D: (Q->rear-Q->front+1+ MAXSIZE)% MAXSIZE
A: Q->rear-Q->front
B: Q->rear-Q->front+1
C: (Q->rear-Q->front+ MAXSIZE)% MAXSIZE
D: (Q->rear-Q->front+1+ MAXSIZE)% MAXSIZE
举一反三
- 已知循环队列Q->; element[MAXSIZE],队头指示器为Q->;front,队尾指示器为Q->;rear(指向真实队尾的下一个位置),则该队列中元素个数为:() A: Q->;rear-Q->;front B: Q->;rear-Q->;front+1 C: (Q->;rear-Q->;front+ MAXSIZE)% MAXSIZE D: (Q->;rear-Q->;front+1+ MAXSIZE)% MAXSIZE
- 已知循环队列Q->; element[MAXSIZE],队头指示器为Q->;front,队尾指示器为Q->;rear(指向真实队尾的下一个位置),则该队列中元素个数为:() A: Q->;rear-Q->;front B: Q->;rear-Q->;front+1 C: (Q->;rear-Q->;front+ MAXSIZE)% MAXSIZE D: (Q->;rear-Q->;front+1+ MAXSIZE)% MAXSIZE
- 已知循环队列Q->element[MAXSIZE],队头指示器为Q->front,队尾指示器为Q->rear(指向真实队尾的下一个位置),则该队列为空队列的条件为() A: (Q->rear+1)%MAXSIZE==Q->front B: Q->rear==Q->front C: (Q->rear-1)%MAXSIZE==Q->front D: Q->rear+1==Q->front
- 从一个顺序存储的循环队列Q中删除一个元素时,需要( )。 A: Q->;front= (Q->;front-1)%Q->;maxsize B: Q->;front= (Q->;front+1)%Q->;maxsize C: Q->;rear= (Q->; rear +1)%Q->;maxsize D: Q->;rear= (Q->; rear -1)%Q->;maxsize
- 【单选题】已知循环队列 Q-> element[MAXSIZE], 队头指示器为 Q->front ,队尾指示器为 Q->rear (指向真实队尾的下一个位置),则该队列为满队列的条件为()(采用少用一个空间的方法) A. Q->rear= =Q->front B. Q->rear+1= =Q->front C. ( Q->rear+1 ) % MAXSIZE = =Q->front D. ( Q->rear-1 ) % MAXSIZE = =Q->front