E-Dreamer

脚踏实地,仰望星空

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2020年5月1日

摘要: 使用单调队列解决滑动窗口的最大值 #include <iostream> #include <deque> #include <vector> using namespace std; class MonotonicQueue { // 构建单调队列 private: deque<int> data 阅读全文
posted @ 2020-05-01 15:59 E-Dreamer 阅读(422) 评论(0) 推荐(0) 编辑

摘要: PS:归并排序是一个套路迭代的过程,归并排序与数组中的逆序对和最小和问题三个基本上一样,只要理解了归并排序过程,其余两个过程自然可以理解。 直接上代码。 归并排序过程 class Solution { public: void mergeSort(vector<int> &arr) { if (ar 阅读全文
posted @ 2020-05-01 15:53 E-Dreamer 阅读(205) 评论(0) 推荐(0) 编辑