• 2022-06-01
    设循环队列的存储容量为maxSize,队头和队尾指针分别为front和rear。若有一个循环队列Q,可应用下列语句( )计算队列元素个数?
    A: (Q.rear-Q.front+maxSize)%maxSize
    B: Q.rear-Q.front+1
    C: Q.rear-Q.front
    D: (Q.rear-Q.front)%maxSize+1