摘要:
class Stack { public: // Push element x onto stack. void push(int x) { if(q1.empty()&&q2.empty()) q1.push(x); else if(!q1.empty()) q1.push(x); ... 阅读全文
摘要:
class Queue { public: // Push element x to the back of queue. void push(int x) { s1.push(x); } // Removes the element from in front of queue. void pop(void) { if... 阅读全文