In this issue of Crossword Puzzle of the week, we will dive into the topics of Dynamic Programming. The solution to the crossword puzzle is provided at the end.
HINTS:
ACROSS:
1. _____ is a bottom-up approach of dynamic programming where we store the results of the subproblems in a table and use these results to solve larger subproblems until we solve the entire problem.
2. _____ is a top-down approach where we cache the results of function calls and return the cached result if the function is called again with the same inputs.
3. The _____ problem is a classic problem where we have a bag that can hold weight up to a certain value, and we have various items with different weights and values. Now we have to fill the bag in such a way that the sum of the total weights of the filled items does not exceed the maximum capacity of the bag.
4. The _____ problem is another classic DP problem, which helps us find out the longest common subsequence of two strings given to us.
5. _____ is a fundamental technique when creating DP solutions. In this, you have a function that calls itself until some base case is reached.
DOWN:
6. _____ is a technique to solve DP problems where we have a collection of elements that are numbered from 1 to N, and we want to represent a subset of this set then it can be encoded by a sequence of N bits (we usually call this sequence a “mask”).
7. _____ is an iterative dynamic programming algorithm. It calculates the maximum sum subarray ending at a particular position by using the maximum sum subarray ending at the previous position.
8. We can use DP to find out _____ numbers. They are defined as a mathematical sequence that consists of positive integers, which can be used to find the number of possibilities of various combinations.
9. _____ is a problem-solving approach in DP, where we are given the dimension of a sequence of matrices in an array arr[], where the dimension of the ith matrix is (arr[i-1] * arr[i]), the task is to find the most efficient way to multiply these matrices together such that the total number of element multiplications is minimum.
10. _____ is a DP problem-solving approach, where we have to find out the longest possible subsequence in which the elements of the subsequence are sorted in increasing order.
Solution for Crossword Puzzle #12:
Answers:
ACROSS:
1. TABULATIOsN
2. MEMOIZATION
3. KNAPSACK
4. LCS
5. RECURSION
DOWN:
6. BITMASKING
7. KADANE
8. CATALAN
9. MCM
10. LIS