Question: Parenthesize an Arithmetic Expression Suppose you are given a sequence of n nonnegative numbers separated by n - 1 addition ( + ) and and

Parenthesize an Arithmetic Expression Suppose you are given a sequence of n nonnegative numbers separated by n-1 addition (+) and and multiplication (x) operators, e.g.,2x3 x 0+6+2 x 5+4. Depending on how you parenthesize the expression it may evaluate to different values, e.g., for the expression above:
((2 x 3) x (0+6))+(2 x (5+4))=54
(2 x 3)(0+(6+2)(5+4)))=432
(2 x (3 x 0))+(6+((2 x 5)+4))=20
Given a list of n integers seperated by + and * signs we want to compute the smallest possible value we can obtain by inserting paraenthesses your input is an array A[1......2n-1] where each A[i] is an integer if i is odd and + and * if i is even
Gven A. write down recursive formulation of the minumun possible value of the expressions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!

Related Book