判定一个队列QU(最多元素为m0)为满队列的条件是A.QU->rear - QU->front = = m0 B.QU->rear - QU->front -1= = m0 C.QU->front = = QU->rear D.QU->front = = QU->rear+1

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 16:34:51

判定一个队列QU(最多元素为m0)为满队列的条件是A.QU->rear - QU->front = = m0 B.QU->rear - QU->front -1= = m0 C.QU->front = = QU->rear D.QU->front = = QU->rear+1
判定一个队列QU(最多元素为m0)为满队列的条件是
A.QU->rear - QU->front = = m0 B.QU->rear - QU->front -1= = m0
C.QU->front = = QU->rear D.QU->front = = QU->rear+1

判定一个队列QU(最多元素为m0)为满队列的条件是A.QU->rear - QU->front = = m0 B.QU->rear - QU->front -1= = m0 C.QU->front = = QU->rear D.QU->front = = QU->rear+1
队满条件是元素个数为m0.由于约定满队时队首指针与队尾指针相差1,所以不必再减1了,应当选A.当然,更正确的答案应该取模,即:QU->front = = (QU->rear+1)% m0