摘要: /* * @lc app=leetcode.cn id=225 lang=cpp * * [225] 用队列实现栈 */ // @lc code=start class MyStack { public: MyStack() { q1 = new queue<int>; q2 = new queue 阅读全文
posted @ 2024-01-21 18:25 AngDH 阅读(2) 评论(0) 推荐(0) 编辑
摘要: /* * @lc app=leetcode.cn id=232 lang=cpp * * [232] 用栈实现队列 */ // @lc code=start class MyQueue { public: MyQueue() { } void push(int x) { s1.push(x); } 阅读全文
posted @ 2024-01-21 18:01 AngDH 阅读(2) 评论(0) 推荐(0) 编辑