Sliding Window滑动窗口 POJ - 2823
目录
An 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.
向您提供大小为 n ≤ 106的阵列。有一个大小k的滑动窗口,从阵列的左侧移动到最右侧。您只能在窗口中看到k数字。每次滑动窗口向右移动一个位置。下面是一个例子:
阵列是[1 3 -1 -3 5 3 6 7], k是 3。
Window p |
---|