摘要: 1.优先队列((priority_queue) void testCreatePriority_queue() { //最完整创建方式 //1.存储的数据类型 int //2.底层实现的容器类型 vector<int> //3.排序准则 less<int> greater<int> priority 阅读全文
posted @ 2021-09-08 21:20 Creature_lurk 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 1.双向队列(deque) void testDeque() { deque<int> data; data.push_back(1); data.push_front(2); data.push_back(3); cout << data.size() << endl; while (!data. 阅读全文
posted @ 2021-09-08 21:13 Creature_lurk 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 1.队列 先进先出 /* push(); pop(); front(); size(); empty(); */ using namespace std; void testQueue() { queue<string> strQue; strQue.push("Love"); strQue.pus 阅读全文
posted @ 2021-09-08 21:08 Creature_lurk 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 1.stack 后进先出 /* 1.基本操作 push(); pop(); top(); size(); empty(); */ void testStack() { stack<int> s; for (int i = 0; i < 10; i++) { s.push(i); } cout << 阅读全文
posted @ 2021-09-08 20:40 Creature_lurk 阅读(26) 评论(0) 推荐(0) 编辑