经典指数          
原因
2216
浏览数
0
收藏数
 

设数组data[m]作为循环队列的存储空间。front为队头指针,rear为队尾指针,则执行出队操作后其头指针front值为()
  • front=front+1
  • front=(front+1)%(m-1)
  • front=(front-1)%m
  • front=(front+1)%m

     举报   纠错  
 
切换
1 个答案
循环队列的相关条件和公式:   队尾指针是rear,队头是front,其中QueueSize为循环队列的最大长度   1.队空条件:rear==front   2.队满条件:(rear+1) %QueueSIze==front   3.计算队列长度:(rear-front+QueueSize)%QueueSize   4.入队:(rear+1)%QueueSize   5.出队:(front+1)%QueueSize
 
切换
撰写答案
扫描后移动端查看本题