Skip to main content

36 SECTIONS · 696 TOPICS

Algorithm Patterns Roadmap

  1. Dynamic Programming (DP) Patterns

    1. 1. 0/1 Knapsack Problem (Space Optimization)
    2. Example: 0/1 Knapsack 2D DP
    3. Example: 0/1 Knapsack 1D optimized
    4. Example: Partition equal subset sum (0/1 knapsack variant)
    5. 2. Unbounded Knapsack (Bottom-Up DP)
    6. Example: Unbounded knapsack
    7. Example: Coin change (ways to make amount)
    8. Example: Rod cutting problem
    9. 3. Longest Common Subsequence (LCS Algorithm)
    10. Example: Longest common subsequence
    11. Example: LCS with path reconstruction
    12. Example: Space-optimized LCS O(min(m,n))
    13. 4. Longest Increasing Subsequence (LIS O(n log n))
    14. Example: LIS with O(n²) DP
    15. Example: LIS with binary search O(n log n)
    16. Example: LIS with reconstruction
    17. 5. Coin Change Minimum Coins Problem
    18. Example: Coin change minimum coins
    19. Example: Coin change with path
    20. Example: Coin change II (count ways)
    21. 6. Palindromic Substrings (Expand Around Centers)
    22. Example: Count palindromic substrings
    23. Example: Longest palindromic substring
    24. Example: Palindromic substrings DP approach
    25. 7. Edit Distance (Levenshtein Distance Algorithm)
    26. Example: Edit distance (Levenshtein distance)
    27. Example: Space-optimized edit distance
    28. Example: One edit distance
    29. 8. Maximum Subarray Sum (Kadane's Algorithm)
    30. Example: Kadane's algorithm
    31. Example: Kadane with indices
    32. Example: Circular array maximum subarray
    33. 9. House Robber Problem (DP State Transitions)
    34. Example: House robber I
    35. Example: House robber II (circular)
    36. Example: House robber III (binary tree)
    37. 1. 0/1 Knapsack Problem (Space Optimization)
    38. Example: Binary tree diameter
    39. Example: Binary tree maximum path sum
    40. Example: Count good nodes in tree
    41. 1. 0/1 Knapsack Problem (Space Optimization)
    42. Example: Traveling salesman problem (TSP)
    43. Example: Minimum cost to connect all points (Steiner tree)
    44. Example: Partition into k equal sum subsets
    45. 1. 0/1 Knapsack Problem (Space Optimization)
    46. Example: Matrix chain multiplication
    47. Example: Burst balloons
    48. Example: Palindrome partitioning II