栈与队列理论基础:优化排版
This commit is contained in:
parent
57af6f6a4b
commit
71ada4737a
|
|
@ -67,7 +67,7 @@ deque是一个双向队列,只要封住一段,只开通另一端就可以实
|
||||||
|
|
||||||
我们也可以指定vector为栈的底层实现,初始化语句如下:
|
我们也可以指定vector为栈的底层实现,初始化语句如下:
|
||||||
|
|
||||||
```
|
```cpp
|
||||||
std::stack<int, std::vector<int> > third; // 使用vector为底层容器的栈
|
std::stack<int, std::vector<int> > third; // 使用vector为底层容器的栈
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -77,7 +77,7 @@ std::stack<int, std::vector<int> > third; // 使用vector为底层容器的栈
|
||||||
|
|
||||||
也可以指定list 为起底层实现,初始化queue的语句如下:
|
也可以指定list 为起底层实现,初始化queue的语句如下:
|
||||||
|
|
||||||
```
|
```cpp
|
||||||
std::queue<int, std::list<int>> third; // 定义以list为底层容器的队列
|
std::queue<int, std::list<int>> third; // 定义以list为底层容器的队列
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue