码迷,mamicode.com
首页 >  
搜索关键字:sliding    ( 270个结果
[leetcode 239]Sliding Window Maximum
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window...
分类:Windows程序   时间:2015-08-07 20:14:01    阅读次数:208
单调队列
大概2014年10月去看了下单调队列,那算法还是挺不错的,总是能最快的求出在某个区间的最值。那时做了几道题巩固下,后面一直没看了,然后今天偶遇一道类似的题,https://leetcode.com/problems/sliding-window-maximum/,看到时想起来是这个算法。但是忘光了,...
分类:其他好文   时间:2015-08-03 20:56:48    阅读次数:109
leetcode 239 Sliding Window Maximum
这题是典型的堆排序算法,只是比一般的堆算法多了删除的操作,有两件事需要做:1 用一个hash表存储从输入数组索引到堆数组(用于实现堆的那个数组)所以的映射,以便在需要删除一个元素的时候能迅速定位到堆数组中的位置2用一个set保存已经被删除的元素索引(这里指的是输入数组索引),这一点可选;还有一种做法...
分类:Windows程序   时间:2015-08-02 10:05:02    阅读次数:151
leetcode Ch6-Data Structure
1.Sliding Window Maximum 1 class Solution { 2 public: 3 vector maxSlidingWindow(vector &nums, int k) { 4 deque dq; 5 vector res; 6...
分类:其他好文   时间:2015-07-30 18:27:08    阅读次数:96
poj 2823 Sliding Window (单调队列)
Sliding WindowTime Limit:12000MSMemory Limit:65536KTotal Submissions:46705Accepted:13485Case Time Limit:5000MSDescriptionAn array of sizen≤ 106is give...
分类:Windows程序   时间:2015-07-29 22:44:43    阅读次数:714
POJ 2823 Sliding Window
Sliding WindowDescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving ...
分类:Windows程序   时间:2015-07-29 15:24:33    阅读次数:205
POJ 题目2823 Sliding Window(RMQ,固定区间长度)
Sliding Window Time Limit: 12000MS   Memory Limit: 65536K Total Submissions: 46507   Accepted: 13442 Case Time Limit: 5000MS Description An array of size n ≤ 106 is ...
分类:Windows程序   时间:2015-07-27 13:12:13    阅读次数:186
POJ 2823 Sliding Window(单调队列)
单调队列典型题 An array of size n ≤ 10 6 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the windo...
分类:Windows程序   时间:2015-07-27 01:57:10    阅读次数:194
八数码块
The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, eac...
分类:其他好文   时间:2015-07-26 20:30:06    阅读次数:106
(heap)239. Sliding Window Maximum
题目:Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbe...
分类:Windows程序   时间:2015-07-26 17:08:58    阅读次数:157
270条   上一页 1 ... 17 18 19 20 21 ... 27 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!