Archive:

Dynamic Programming


Base condn: Smallest valid input and Invalid input

Knapsack

LCS

MCM

int solve(int i, int j)
{
   for(int k=i;k<j;k++)
   {
        calculate temp ans
        tempans = func(solve(i,k),solve(k+1,j)); 
        update ans from temp ans;
   }
   return ans
}