设循环队列中数组的下标为0~N-1,其队头、队尾指针分别为front和rear(front指向队列中队头元素的前一个位置,rear指向队尾元素的位置),则其元素个数为( )。
选项:
A:Rear-front
B:Rear-front-1
C:(rear-front)%N+1
D:(rear-front+N)%N
发布时间:2024-03-30 23:57:14