需要了解德克

Need an understanding on deque

本文关键字:德克 了解      更新时间:2023-10-16

我不明白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。