两个队列实现一个栈
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user