Category Archives: Dynamic Programming

Friends Pairing Problem

Given n friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find out the total number of ways in which friends can remain single or can be paired up. Examples: Input : n = 3 Output : 4 Explanation {1}, {2}, {3}… Read More »

Minimum Sum Path In 3-D Array

Given a 3-D array arr[l][m][n], the task is to find the minimum path sum from the first cell of array to the last cell of array. We can only traverse to adjacent element, i.e., from a given cell (i, j, k), cells (i+1, j, k), (i, j+1, k) and (i, j, k+1) can be traversed,… Read More »

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. The problem is not actually to perform the multiplications, but merely to decide in which order to perform the multiplications. We have many options to multiply a chain of matrices… Read More »