现在有一个长度为 5 的环形队列为 quene ,使用数组实现,队首元素所在下标 pFront 值为 3 ;新数据要插入的位置下标 pBack 值为 2 :
以下哪一条操作序列可以使 pFront 变为 1 , pBack 的值变为 0 ()
type | start | pop | push | pop | pop | push | pop | push |
---|---|---|---|---|---|---|---|---|
PFront | 3 | 4 | 4 | 0 | 1 | 1 | 2 | 2 |
PBack | 2 | 2 | 3 | 3 | 3 | 4 | 4 | 0 |
type | start | pop | push | pop | pop | push | pop | push |
---|---|---|---|---|---|---|---|---|
PFront | 3 | 4 | 4 | 0 | 1 | 1 | 2 | 2 |
PBack | 2 | 2 | 3 | 3 | 3 | 4 | 4 | 0 |
type | start | push | push | push | push | pop | push | push |
---|---|---|---|---|---|---|---|---|
PFront | 3 | 3 | 3 | 3 | 3 | 4 | 4 | 4 |
PBack | 2 | 3 | 4 | 0 | 1 | 1 | 2 | 3 |
type | start | push | push | pop | pop | push | pop | pop |
---|---|---|---|---|---|---|---|---|
PFront | 3 | 3 | 3 | 4 | 0 | 0 | 1 | 2 |
PBack | 2 | 3 | 4 | 4 | 4 | 0 | 0 | 0 |