Tag: dynamic_programming
Longest Common Subsequence
Date: 3/6/2024Tags:algorithmsleetcodedynamic_programmingThe journal entry discusses solving the Longest Common Subsequence problem through recursion, memoization using a hash table, and a dynamic programming table approach, with the provided code implementing the efficient bottom-up dynamic programming method to find the longest common subsequence length between two strings.
House Robber
Date: 3/1/2024Tags:algorithmsleetcodedynamic_programmingThe "House Robber" problem is efficiently solved using dynamic programming by constructing an array representing the maximum amount that can be robbed at each house, considering the rule of not robbing adjacent houses, and returning the final element of this array; the implementation of this solution is a JavaScript code with a `rob` function that iterates through the input array to calculate the maximum robbery amount.
Unique Paths
Date: 2/29/2024Tags:algorithmsleetcodedynamic_programmingThe journal entry discusses solving the "Unique Paths" problem using dynamic programming through three iterations, highlighting the evolution from recursion to 2D array memoization to optimize calculating the number of ways to go from the start to a cell, aiming at improving performance for reaching the target in an efficient manner.
Maximum Subarray - Kadane's algorithm
Date: 2/29/2024Tags:algorithmsleetcodedynamic_programmingTitle: Maximum Subarray - Kadane's algorithm, explores using Kadane's algorithm to find the maximum sum of subarrays. The corresponding code implement the algorithm in a function called maxSubArray that returns the maximum sum of a subarray within a given array of numbers, resetting the current sum to 0 if it becomes negative.
Coin Change
Date: 2/16/2024Tags:algorithmsleetcodedynamic_programmingThe journal entry discusses the three steps involved in dynamic programming, including finding a recursive solution, using memoization with a hash table, and implementing a bottom-up approach, with accompanying code for the "Coin Change" problem.