需要了解双端队列
Need an understanding on deque
我不明白为什么 d[5] 的答案是 C。我试图理解 C++ 中的列表,但出于某种原因,这个概念让我逃避了。谁能解释为什么 C 是正确答案?
The following represents output from the call d.Dump() from the
fsu::Deque<char> object d:
content_[i]: A B C D E F G H I J
i mod 10: 0 1 2 3 4 5 6 7 8 9
e b
What is the result of the output statement
std::cout << d[5];?
如果 b 代表队列的开头,则向右数 5 步,从 9 跳到 0。您最终到达 C。
我不明白为什么 d[5] 的答案是 C。我试图理解 C++ 中的列表,但出于某种原因,这个概念让我逃避了。谁能解释为什么 C 是正确答案?
The following represents output from the call d.Dump() from the
fsu::Deque<char> object d:
content_[i]: A B C D E F G H I J
i mod 10: 0 1 2 3 4 5 6 7 8 9
e b
What is the result of the output statement
std::cout << d[5];?
如果 b 代表队列的开头,则向右数 5 步,从 9 跳到 0。您最终到达 C。