移动窗口算法 [英] Moving window algorithm

查看:248
本文介绍了移动窗口算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我有 N 整数, M ,从范围内的每个随机选择<$ C $的数组C> [X,Y] 。

Say I have an array of n integers, m, each chosen randomly from the range [x,y].

我也有固定大小的窗口 [A,B] ,而且比小[X,Y] 这样 BA&LT; X-Y

I also have a window of fixed size [a,b], and smaller than [x,y] such that b-a < x-y.

从任意窗口的位置开始,任何人都可以认为一个好的算法来使用,以确定是否有可能为窗口,以移动,使得 M 中的所有元素窗口内被封闭?

Starting from an arbitrary window position, can anyone think of a good algorithm to use to determine whether it is possible for the window to be moved such that all elements of m are enclosed within the window?

推荐答案

你就不能获得最小最高从序列号 M ,看看他们是否适合在 [A,B] 的间隔?也许我没有得到窗口的意义的事情。

Can't you just get the minimum and maximum number from the array m and see if they fit in the [a,b] interval? Maybe I don't get the meaning of the window thing.

这篇关于移动窗口算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆