diff --git a/Data Structure Algorithms/Matrix_Chain_Multiplication_DP.cpp b/Data Structure Algorithms/Matrix_Chain_Multiplication_DP.cpp new file mode 100644 index 0000000..a96253b --- /dev/null +++ b/Data Structure Algorithms/Matrix_Chain_Multiplication_DP.cpp @@ -0,0 +1,41 @@ +#include +using namespace std; + +/*Following is the implementation of the Matrix Chain Multiplication problem + using Dynamic Programming */ + +class Solution{ +public: + int dp[102][102]; + int fun(int a[],int n,int i,int j) + { + if(i>=j)return 0; + if(dp[i][j]!=-1)return dp[i][j]; + int mn=INT_MAX; + for(int k=i;k>N; + int arr[N]; + for(int i = 0;i < N;i++) + cin>>arr[i]; + + Solution ob; + cout<