![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
算法题笔记
Xxvinci_
noting
展开
-
两个栈实现队列
题目: https://www.acwing.com/problem/content/description/36/ Tips: 不需要重复在两个栈之间搬运 代码: class MyQueue { public: stack<int> s1, s2; /** Initialize your data structure here. */ MyQueue() { } /** Push element x to the b原创 2021-03-18 17:51:44 · 74 阅读 · 0 评论 -
含有重复元素的排列
题目: https://www.acwing.com/problem/content/47/ Tips: 跳过搜索与上一个元素重复的元素即可 代码 class Solution { public: vector<vector<int>> res; vector<int> inputs; bool st[100] = {false}; vector<int> v; void dfs(vector<in原创 2021-03-18 17:47:08 · 107 阅读 · 0 评论