I went through the explanation on lectures and the code given by geeksforgeeks and I have a little doubt in this line :
In this piece of code:
What I understood from the solution was that we take price of one piece and take the best of what else is left. For example : If the length of rod is 4 then we should take max of (Price of not cutting at all,that is taking the rod of 4 as it is to get the maximum revenue, (Price of 1 ,best of 3  Price of 2,best of 2,etc..)) So according to me the code should be : max_val = max(Price of ith piece,Price[j]+val[ij1]) or something like that. asked 24 Dec '14, 13:41

As asked above
Please see in the code above, lets say I have to find solution for length 4. Then subproblems I have is i.e. max_value will hold the maximum of all the subproblems. After the inner loop I am finally assigning this value to val[i]. Putting price[i] is of no significance since that is the solution for the subproblem (0,len). We are concerned with all the subproblems and this one gets covered when j is 0 for every i. However, we may have done like:
answered 28 Dec '14, 00:22
