循環隊列用數組A[0,m-1]存放其元素值,已知其頭尾指針分別是front和rear,則當前隊列中的元素個數是()
A.(rear-front+m)%m
B.rear-front+1
C.rear-front-1
D.rear-front
正確答案:(rear-front+m)%m
循環隊列用數組A[0,m-1]存放其元素值,已知其頭尾指針分別是front和rear,則當前隊列中的元素個數是()
A.(rear-front+m)%m
B.rear-front+1
C.rear-front-1
D.rear-front
正確答案:(rear-front+m)%m