【问题标题】:Stack, Queue decleration堆栈、队列声明
【发布时间】:2017-06-01 08:55:57
【问题描述】:

我明天要参加数据结构的期末考试,教授。分发的补充问题。其中一个在下面。在处理这个问题时,我被困在第 3 行和第 4 行。 "B(2,A)" 是什么意思?第 4 行的 "X C (3, 5);" 对我来说也是个问题。我知道 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++ 书,here 是一些很好的资源
  • 换个老师,写考试的人应该被解雇,我在 void main(void) 窒息后无法阅读......

标签: c++ oop data-structures stack queue


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2021-03-17
    • 2014-04-21
    • 2013-09-18
    • 1970-01-01
    • 1970-01-01
    • 2016-02-04
    • 2014-07-21
    • 2015-11-16
    • 2019-03-07
    相关资源
    最近更新 更多