Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 11d4309

Browse files
Add readme for sliding window pattern
1 parent f52abb3 commit 11d4309

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Sliding Window Pattern
2+
3+
Caculating something with the contiguous sub array or sub list of a given size "k".
4+
5+
[7, 43, 4, 6, 8, 11, 2]
6+
[i j] --> Sliding Window ([7, 43, 4, 6]) of size "4".
7+
8+
Everytime we slide this window, remove first element (7) from calculation and add next element (6) in the calculation and window.
9+
10+
* When size of sliding window in not fixed.
11+
First we will add-up element from the beginning of array until their condition becomes false in prespective with the given unit.
12+
13+
These elements constitute our sliding window.
14+
15+
After this, we will keep adding one element in sliding window in a stepwise fashion.
16+
17+
We will shrink the window from the beginning.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /