In Matrix Chain Multiplication problem we have to find an optimal solution to multiply given matrices. The problem is not multiply the matrices but to find the sequence of matrix … Continue Reading

## Bellman – Ford Algorithm – Dynamic Programming

The **Bellman **– **Ford algorithm** is an **algorithm** that computes shortest paths from a single source vertex to all of the other vertices in a … Continue Reading

## Floyd Warshall Algorithm – Dynamic Programming

The Floyd Warshall algorithm is a shortest path algorithm or graphs. It computes the shortest distances between every pair of vertices in the input graph. We have seen Bellman Ford … Continue Reading

## 0-1 Knapsack Problem – Dynamic Programming

0-1 Knapsack Problem is a famous problem, in which we have given n items with their weights and values. There is a Knapsack of capacity W, we have to pick … Continue Reading

## Longest Common Substring – Dynamic Programming

We have two strings say S1 and S2, we need to find the length of longest common substring.

#### For example

… Continue ReadingInputString S1 = "ThisIsAString1" String S2 = "String2"Output

## Longest Common Subsequence (LCS) – Dynamic Programming (C++, Java Program)

Longest Common Subsequence or LCS is a problem in which we have to find the longest subsequence from two given strings that is common to both. A subsequence is a … Continue Reading