mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 11:34:46 +08:00
栈与队列理论基础:优化排版
This commit is contained in:
@ -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为底层容器的队列
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user