TheAlgorithms / Java

All Algorithms implemented in Java
MIT License
60.18k stars 19.46k forks source link

Add Sliding Window Algorithm Implementations #6000

Open Chiefpatwal opened 1 month ago

Chiefpatwal commented 1 month ago

What would you like to Propose?

I would like to propose adding a dedicated file, SlidingWindow.java, to this repository. This file will contain sliding window algorithms commonly used in competitive programming and interviews. These algorithms include solutions that demonstrate both fixed-length and variable-length sliding window techniques.

Issue details

Currently, the repository lacks sliding window algorithms, a core technique in solving many subarray or substring-related problems efficiently. This proposal aims to address that gap by adding a dedicated file for sliding window algorithms, complete with explanations and test cases.

Additional Information

The following well-known problems will be implemented:

Maximum Sum Subarray of Size KK: This problem is commonly found in coding interviews and challenges.
Longest Substring Without Repeating Characters: A classic problem on platforms like LeetCode, demonstrating the utility of sliding window techniques.
Smallest Subarray with Sum Greater Than SS: This problem is frequently encountered in competitive programming scenarios.

Can also add similar problems.

charu1110 commented 1 month ago

@Chiefpatwal can i work on this issue ?

Chiefpatwal commented 1 month ago

@charu1110 sure you can, i have already created sliding window directory and have added two general problems for the same you can add others.

m-saurabh01 commented 4 weeks ago

Can I add more problems in sliding window section?

Chiefpatwal commented 4 weeks ago

@m-saurabh01 sure