DP solution is .. c[i][j] = min (c[i][k] + c[k][j] + (a[j]-a[i])) where j>i & k=i+1 to j-1 c[i][j] = a[j]-a[i] when j=i+1
c[i][j] indicates the minimum cost to cut the log starting at a[i] and ending at a[j]... c[0][n] gives the answer.. correct me if i am wrong or any better solutions? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.