# Tag Archives: Algorithms-Dynamic Programming

Given a N x N binary matrix. The problem is finding the maximum area sub-matrix having a count of 1’s one more than count of… Read More
Given a square chessboard of N x N size, the position of Knight and position of a target is given, the task is to find… Read More
Given three integers N, M and X, the task is to find the number of ways to form an array, such that all consecutive numbers… Read More
Given a rod of length L, the task is to cut the rod in such a way that the total number of segments of length… Read More
Given N, Find the total number of unique BSTs that can be made using values from 1 to N. Examples: Input: n = 3 Output:… Read More
Given N and K. The task is to find out how many different ways there are to represent N as the sum of K non-zero… Read More
Given an array of N integers, find the length of the longest subsequence of a given sequence such that all elements of the subsequence are… Read More
Given a matrix of size N X N of integers. The task is to find the number of decreasing path in the matrix. You are… Read More
In the above question, which entry of the array X, if TRUE, implies that there is a subset whose elements sum to W? (A) X[1,… Read More
The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a1 ,a2 ,a3 ,…,an} and positive integer W, is… Read More
Four matrices M1, M2, M3 and M4 of dimensions pxq, qxr, rxs and sxt respectively can be multiplied is several ways with different number of… Read More
Kadane algorithm is used to find: (A) Maximum sum subsequence in an array (B) Maximum sum subarray in an array (C) Maximum product subsequence in… Read More
An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array A[0 :n-1] is given below. Let Li denote… Read More
We use dynamic programming approach when (A) We need an optimal solution (B) The solution has optimal substructure (C) The given problem can be reduced… Read More
Which of the following standard algorithms is not Dynamic Programming based. (A) Bellman–Ford Algorithm for single source shortest path (B) Floyd Warshall Algorithm for all… Read More