最大容量为n的循环队列,队尾指针是rear,队头是front,则队满的条件是( )。


最大容量为n的循环队列,队尾指针是rear,队头是front,则队满的条件是( )。

A.(rear+1)%n==front

B.rear==front

C.rear+1==front

D.(rear-l)%n==front

正确答案:(rear+1)%n==front


Tag:数据结构 队列 指针 时间:2021-11-12 13:39:10