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

admin2010-06-06  23

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

选项 A、front=front+1
B、front=(front+1)%(m-1)
C、front=(front-1)%m
D、front=(front+1)%m

答案D

解析 设数组data[m]作为循环队列SQ的存储空间,front为队头指针,rear为队尾指针,则执行出队操作后其头指针front值为front=(front+1)%m。
转载请注明原文地址:https://kaotiyun.com/show/W5jp777K
0

最新回复(0)