ProDeveloperTutorialonJanuary 19, 2025 Dynamic Programming: Unbounded Knapsack Problem Problem Statement: You are given 2 arrays. Value array and corresponding weight associated with it. You need to calculate the maximum amount…
ProDeveloperTutorialonJanuary 19, 2025 Dynamic Programming: Subset sum problem Problem Statement: You are given a non-negtive integers and a sum, you need to check if there is a subset with the sum equal to the given sum.…
ProDeveloperTutorialonJanuary 19, 2025 Dynamic Programming: Get the nth catalan number Problem Statement: You are given an integer “n”, you need to get the “nth” catalan number. What is a Catalan Number? A…
ProDeveloperTutorialonJanuary 19, 2025 Dynamic Programming: Permutation Coefficient Problem Statement: you are given 2 numbers n & k, you need to find permutation coefficient. What is Permutation Coefficient? Permutation…
ProDeveloperTutorialonJanuary 19, 2025 Dynamic Programming: Binomial Coefficiet Problem Problem Statement: You are given 2 values, n & k. You need to find the binomial coefficient of the values. Binomial Coefficient is…
ProDeveloperTutorialonJanuary 19, 2025 0 1 Knapsack Problem using Dynamic Programming Solution Before we start with with the solution. Let us understand the basic of DP in series of points as below: 1. DP will be built on top of…
ProDeveloperTutorialonJanuary 19, 2025 Detect a cycle in a undirected graph Problem Statement: You are given a undirected graph. You need to find out if the graph contains cycle or not. Example Solution We can use DFS…
ProDeveloperTutorialonJanuary 19, 2025 Detect a cycle in a directed graph Problem Statement: You are given a directed graph. You need to find out if the graph contains cycle or not. Example Solution We shall use DFS…
ProDeveloperTutorialonJanuary 19, 2025 Heaps: Merge “K” sorted arrays Problem Statement: You are given k sorted arrays of size n each. You need to merge them and print the sorted output. Example k = 3, n = 4…
ProDeveloperTutorialonJanuary 19, 2025 Heaps: Find kth smallest in an unsorted array Problem Statement: You are given an array and a number K, you need to find the kth smallest element. Example Input: arr[] = {5, 20, 10, 7, 1},…