Skip to content

Latest commit

 

History

History
61 lines (49 loc) · 1.36 KB

File metadata and controls

61 lines (49 loc) · 1.36 KB

coding Patterns and sub problem list

  1. Sliding Window Longest substring without repeating characters Maximum sum of subarrays of size K Smallest subarray with a given sum

  2. Two Pointers Pair with target sum in sorted array Remove duplicates from sorted array Triplets that sum to zero

  3. Fast & Slow Pointers Detect cycle in a linked list Find the middle of a linked list Happy number

  4. Merge Intervals Merge overlapping intervals Insert an interval in sorted intervals Intervals intersection

  5. Cyclic Sort Find the missing number Find all duplicate numbers Find the smallest missing positive number

  6. Tree Traversal In-order, pre-order, and post-order traversal of binary tree Level order traversal of binary tree Zigzag level order traversal

  7. Top 'K' Elements Top 'K' frequent numbers Top 'K' largest numbers in a stream Kth smallest number in an unsorted array

  8. Subsets Subsets of a given set Permutations of a set Unique subsets with duplicates

  9. Modified Binary Search Find an element in a rotated sorted array Search in a sorted matrix Find the floor of a number

  10. Dynamic Programming 0/1 Knapsack problem Longest common subsequence Fibonacci numbers

  11. Backtracking Generate all subsets of a set N-Queens problem Sudoku solver

  12. Union Find Find connected components in a graph Detect cycles in an undirected graph Kruskal's algorithm for minimum spanning tree