堆栈,队列延迟



我明天有期末考试,教授。 分布式上问题。 其中之一如下。在处理这个问题时,我被困在第 3 行和第 4 行。"B(2,A)"是什么意思?也是"X C (3, 5);"在 4 号线对我来说是一个问题。我知道 B 是队列,但 X 是什么?提前致谢

Draw a diagram that shows the data structures created when the following code is executed:
1-void main (void)
2-{ Queue<int> A; for (int i=0; i<5; i++) A.QInsert(i);
3-X < Queue <int> > B (2, A);
4-X < int > C (3, 5);
5-Stack <X <int> > D; for (int i=5; i<6; i++) D.Push (C)

这是一个构造函数,它基于以前的队列构造一个新队列。您可以在C++参考中阅读有关它的更多信息。这是了解C++数据结构的一个非常好的来源。

最新更新