# Category Archives: Dynamic Programming (adsbygoogle = window.adsbygoogle || []).push({});

## Printing brackets in Matrix Chain Multiplication Problem

Prerequisite : Dynamic Programming | Set 8 (Matrix Chain Multiplication) Given a sequence of matrices, find the most efficient way to multiply these matrices together.… Read More »

## Maximum path sum in a triangle.

We have given numbers in form of triangle, by starting at the top of the triangle and moving to adjacent numbers on the row below,… Read More »

## Maximum points collected by two persons allowed to meet once

Given a 2-D matrix A[N][M] where A[i][j] denotes the points available on this cell. Two persons, P1 and P2, start from two corners of this… Read More »

## Count of AP (Arithmetic Progression) Subsequences in an array

Given an array of n positive integers. The task is to count the number of Arithmetic Progression subsequence in the array. Note: Empty sequence or… Read More »

## Check whether row or column swaps produce maximum size binary sub-matrix with all 1s

Given a binary matrix, the task is to find whether row swaps or column swaps give maximum size sub-matrix with all 1’s. In a row… Read More »

## Find Maximum dot product of two arrays with insertion of 0’s

Given two arrays of positive integers of size m and n where m > n. We need to maximize the dot product by inserting zeros… Read More »

## Probability of Knight to remain in the chessboard

Given an NxN chessboard and a Knight at position (x,y). The Knight has to take exactly K steps, where at each step it chooses any… Read More »

## LCS (Longest Common Subsequence) of three strings

Given 3 strings of all having length < 100,the task is to find the longest common sub-sequence in all three given sequences. Examples: Input :… Read More »

## Minimum number of elements which are not part of Increasing or decreasing subsequence in array

Given an array of n elements. Make strictly increasing and strictly decreasing subsequences from the array such that each array element belongs to increasing subsequence… Read More »

## Unbounded Knapsack (Repetition of items allowed)

Given a knapsack weight W and a set of n items with certain value vali and weight wti, we need to calculate minimum amount that… Read More »

## Ways to write n as sum of two or more positive integers

For a given number n > 0, find the number of different ways in which n can be written as a sum of at two… Read More »

## Count of subarrays whose maximum element is greater than k

Given an array of n elements and an integer k. The task is to find the count of subarray which has maximum element greater than… Read More »

## Find all distinct subset (or subsequence) sums of an array

Given a set of integers, find distinct sum that can be generated from the subsets of the given sets and print them in an increasing… Read More »

## Maximum sum Bi-tonic Sub-sequence

Given an array of integers. A subsequence of arr[] is called Bitonic if it is first increasing, then decreasing. Examples : Input : arr[] =… Read More »

## Super Ugly Number (Number whose prime factors are in given set)

Super ugly numbers are positive numbers whose all prime factors are in the given prime list. Given a number n, the task is to find… Read More »