DSA Pattern - Data Structure Concepts

1. Two Pointers

Ref: https://www.pluralsight.com/resources/blog/guides/algorithm-templates-two-pointers-part-1

1.1. Slow and Fast Runner

1.2. Running from both ends of an array

1.3. Running from beginning of 2 arrays / Merging 2 arrays

1.4. Start and End of Sliding Window

1.5. Split & Merge of an array / Divide & Conquer

1.6. Old and New State

1.7. Three Pointers

2. Sliding Windows

Ref: https://medium.com/coders-mojo/day-3-of-30-days-of-data-structures-and-algorithms-and-system-design-simplified-af62dc4aec9c

2.1. Longest Substring Without Repeating Characters

2.2. Minimum Window Substring

2.3. Substring with Concatenation of All Words

2.4. Longest Substring with At Most Two Distinct Characters

2.5. Find All Anagrams in a String

2.6. Minimum Size Subarray Sum

2.7. Sliding Window Maximum

2.8. Longest Substring with At Most K Distinct Characters

2.9. Longest Repeating Character Replacement

2.10. Permutation in String

2.11. Count Unique Characters of All Substrings of a Given String

2.12. Fruit Into Baskets

2.13. Minimum Number of K Consecutive Bit Flips

3. Backtracking

Ref:

3.1. Generate Parentheses

3.2. Combination Sum

3.3. Subsets

3.5. Subsets

3.6. Subsets II

3.7. Combination Sum II

3.8. N-Queens

Last Updated On April 5, 2025