C++ Standard Template Library

借助《c++ 17入门经典 第五版》和 Geeksforgeeks网站进行总结归纳c++。

一、容器与算法

  1. 双向队列简单遍历方式
deque<int> my_deque;

// some mutators

for (int element : my_deque)
      cout << element << ' ';
cout << endl;

  1. 栈或单向队列简单遍历方式
stack<int> my_stack;

// some mutators

while (!my_stack.empty())
{
      cout << my_stack.top << ' ';
      my_stack.pop();
}
cout << endl;

参考

GeeksforGeeks

作者:yusq77

-------------------------------------------

Wish you all the best and good health in 2021.

原文地址:https://www.cnblogs.com/yusq77/p/13591705.html