两个队列实现一个栈

This commit is contained in:
2023-05-18 19:37:28 +08:00
parent 47ae4cce3c
commit 29ddbd5a3e
5 changed files with 108 additions and 2 deletions
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include <stack>
namespace yaha {
class CQueue {
public:
CQueue() {
}
void append_tail(int value);
int delete_head();
private:
std::stack<int> _stk_tail;
std::stack<int> _stk_head;
};
}