@juver++: Do we need a 2-D array or 1-D array will be sufficient? That means if I take 1-D array then max[i] will represent the maximum value of the subexpression from 0 to i.and for i+1 we will use the result we have got in max[i].Thus we will be able to calculate max[N-1] which is the maximum value of the total expression.
Please notify me if I am missing something. On 12/19/10, juver++ <[email protected]> wrote: > It's a classic dynamic programming problem. > min[i][j] - minimum value for the subexpression starting at i-th position > and ending at j-th, max[i][j] - the same but stores maximum value. > Use these value to calculate value max[0][N-1], N - size of the expression. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
