aboutsummaryrefslogtreecommitdiff
path: root/other/stack_using_queues.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'other/stack_using_queues.cpp')
-rw-r--r--other/stack_using_queues.cpp24
1 files changed, 0 insertions, 24 deletions
diff --git a/other/stack_using_queues.cpp b/other/stack_using_queues.cpp
deleted file mode 100644
index 61e2c88..0000000
--- a/other/stack_using_queues.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "leetcode.h"
-
-class MyStack {
-public:
- queue<int> q;
- MyStack() {}
- void push(int x) {
- int n = q.size();
- q.push(x);
- while (n--) {
- q.push(q.front());
- q.pop();
- }
- }
- int pop() {
- int ans = top();
- q.pop();
- return ans;
- }
- int top() { return q.front(); }
- bool empty() { return q.empty(); }
-};
-
-int main() {}