0% found this document useful (0 votes)
6 views3 pages

Essential Coding Patterns and Techniques

The document outlines various data structures and algorithms categorized by topics such as Arrays, Strings, Hashing, and more, each with core patterns and use cases. It provides examples of problems associated with each topic, such as 'Two Sum' for Arrays and 'Valid Anagram' for Strings. The document serves as a guide for practicing and understanding essential concepts in data structures and algorithms over a structured timeline.

Uploaded by

Lohith Bommana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Essential Coding Patterns and Techniques

The document outlines various data structures and algorithms categorized by topics such as Arrays, Strings, Hashing, and more, each with core patterns and use cases. It provides examples of problems associated with each topic, such as 'Two Sum' for Arrays and 'Valid Anagram' for Strings. The document serves as a guide for practicing and understanding essential concepts in data structures and algorithms over a structured timeline.

Uploaded by

Lohith Bommana
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DSA

🧩 Topic 🧠 Core Patterns to 💡


Use Cases / 🧪 Example
Practice Common Problems Problems

Arrays & - Prefix Sum Subarray sum, Two Sum, Max


Math(2 days ) - Sliding Window max/min window, Subarray, Merge
- Two Pointer peak elements, Intervals, Search
- Sorting rotations, duplicates, Insert Position
- Kadane's Algorithm merging, searching
- Binary Search on Arrays

Strings( 2 - Hashing Longest substring, Valid Anagram,


days) - Two Pointer anagram check, Longest Substring
- Sliding Window pattern matching, Without Repeating,
- Frequency Map duplicate characters Group Anagrams
- Palindrome Check

Hashing ( 2 - Maps & Sets Count frequency, Subarray Sum


days )(Maps & - Frequency Maps detect duplicates, Equals K, Two Sum,
Sets) - Prefix Hashing store Top K Frequent
- Hashing for Pairs index/frequency, Elements, First
prefix sums, pairs Unique Character
with sum

Two Pointers / - Fixed-size Window - Find windows with Longest Substring


Sliding Variable-size Window - max/min conditions, with K Distinct,
Window( 2 Max/Min Window - substrings of K Minimum Window
days ) Left/Right Expansion distinct chars, target Substring, Max Sum
sum subarrays Subarray of Size K

Recursion( 2 - Basic Recursion Repetition logic, Factorial, Fibonacci,


days ) - Tail Recursion factorial, fibonacci, Generate
- Divide and Conquer permutations, tree Parentheses,
traversals Subsets

Backtracking( - Subsets Path finding, N-Queens, Sudoku


2 days ) - Permutations constraint-based Solver, Word
- Solve Maze/Grid problems, generate Search, Rat in a
- Constraint Satisfaction valid configurations Maze

Linked List( 2 - Fast & Slow Pointer Reverse, detect loop, Reverse Linked List,
days ) - Reversal merge sort, remove Detect Cycle, Merge
- Merging nth node, middle Two Sorted Lists
- Cycle Detection node
Stack & - Monotonic Stack Span problems, Daily Temperatures,
Queue - Balanced Parentheses expression parsing, Valid Parentheses,
(Deque)( 2 - Next Greater Element window max, recent Next Greater
days ) - LRU Cache history Element, LRU
Cache

Binary Trees - DFS (Inorder, Preorder, Tree traversal, find Diameter of Binary
& BST( 2 days Postorder) height, check Tree, Symmetric
) - BFS balance, LCA, Tree, Lowest
- Recursion serialize, Common Ancestor,
- LCA vertical/horizontal Top View
- Tree Views views

Heap / Priority - Top K Elements Kth largest/smallest, Kth Largest


Queue ( 2 - Heapify real-time ordering, Element, Find
days ) - Min/Max Heap priority scheduling Median from Data
Stream, Connect
Ropes

Binary - Lower/Upper Bound Sorted array/window Search in Rotated


Search( 2 - Binary Search on problems, answer Sorted Array,
days ) Answer range finding, Median of Two
- Rotated Sorted Array element count Sorted Arrays,
Search Aggressive Cows

Greedy( 2 - Sorting + Decisions Always make best Jump Game, Gas


days ) - Activity Selection local choice → Station, Minimum
- Fractional Knapsack overall optimal, Platforms, Job
- Interval Scheduling time/slot scheduling Scheduling

Graphs (BFS, - BFS Explore nodes/paths, Number of Islands,


DFS) ( 2 days - DFS cycles, Course Schedule,
) - Topological Sort shortest/longest Network Delay
- Dijkstra paths, connected Time, Kruskal’s MST
- Union-Find - MST components

Union-Find / - Union - Find - Path Connected Find Circle Number,


Disjoint Set( 2 Compression components, cycle Redundant
days ) detection in Connection
undirected graph

Trie( 2 days ) - Insert/Search Word Prefix-based search, Word Search II,


- Prefix Matching dictionary problems, Implement Trie,
- Word Break segment matching Replace Words
- Auto-complete
Dynamic - Memoization - Overlapping 0/1 Knapsack,
Programming( Tabulation - State subproblems, optimal Longest Palindromic
2 days ) Transition - Matrix DP - substructure, Substring, Coin
Subset Problems min/max Change, Edit
cost/path/value Distance

Bit - Set/Clear/Toggle Bits Unique number, Single Number,


Manipulation( - XOR Tricks subset generation, Power of Two,
2 days ) - Bitmasking power-of-two checks Subsets using
- Counting Set Bits Bitmask

Sliding - Fixed + Variable Subarray/string Longest Substring


Window Window problems with with No Repeats,
(Extra) - Min/Max Window dynamic window Max Sum Subarray,
- Distinct/Repeat Tracking sizing Minimum Window
Substring

You might also like