- 5416program1 一个5416的关于图象过滤与取反的源代码
- A_D_translate 利用实验板上的ADC0809做A/D转换器
- pso A modified version of PSO algorithm which can be used to search the minimum value inside a specified range. Using f1s.m to test the function!
- ADC0832 /* 功能:该程序可实现对的控制
- 7289 单片机控制程序源码 2789可外接 按键 数码管显示等 可节省很多IO口
- led-pwm PWM 控制 LED 灯渐亮渐灭程序 适用 ME300B 开发系统 晶振为11.0592M 利用定时器控制产生占空比可变的 PWM 波 按K1
文件名称:sliding
介绍说明--下载内容来自于网络,使用问题请自行百度
求出sliding window的最大最小值-n array of size n ≤ 106 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 window. Each time the sliding window moves rightwards by one position. Following is an example:
The array is [1 3-1-3 5 3 6 7], and k is 3.
Window position Minimum value Maximum value
[1 3 -1]-3 5 3 6 7 -1 3
1 [3 -1 -3] 5 3 6 7 -3 3
1 3 [-1 -3 5] 3 6 7 -3 5
1 3 -1 [-3 5 3] 6 7 -3 5
1 3 -1 -3 [5 3 6] 7 3 6
1 3 -1 -3 5 [3 6 7] 3 7
Your task is to determine the maximum and minimum values in the sliding window at each position.
The array is [1 3-1-3 5 3 6 7], and k is 3.
Window position Minimum value Maximum value
[1 3 -1]-3 5 3 6 7 -1 3
1 [3 -1 -3] 5 3 6 7 -3 3
1 3 [-1 -3 5] 3 6 7 -3 5
1 3 -1 [-3 5 3] 6 7 -3 5
1 3 -1 -3 [5 3 6] 7 3 6
1 3 -1 -3 5 [3 6 7] 3 7
Your task is to determine the maximum and minimum values in the sliding window at each position.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
sliding.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.