单项选择题

数组q[M]存储一个循环队,first和last分别是首尾指针。当前队中元素个数为()。

A.(last-first+M)%M
B.last-first-1
C.last-first
D.last-first+1