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

题库2022-08-02  53

问题 最大容量为n的循环队列,队尾指针是rear,队头是front,则队空的条件是( )。A.(rear+1)MOD n==front B.rear==frontC.rear+1==front  D.(rear-l)MOD n==front

选项 A.(rear+1)MOD n==front
B.rear==front
C.rear+1==front  
D.(rear-l)MOD n==front

答案 B

解析 当头尾指针指向一起时,即为队空。
转载请注明原文地址:https://tihaiku.com/gongwuyuan/2556817.html

最新回复(0)