I am not sure about this but a quick thought on the question:

If we give plus a higher precedence than multiplication, then we get a
higher result.
For eg:

3 + 6 * 7 + 3 * 2

BODMAS => 51

But giving plus a higher precedence will imply 180

Unable to think of any counter examples. Give if any, otherwise a simple
greedy approach is to parenthesize all the plus together and then
parenthesize through the multiplication.

For the above example:  (3+6)*(7+3)*2

Pranav

On Sat, Dec 18, 2010 at 11:15 PM, snehal jain <[email protected]> wrote:

> Given an expression E of n numbers with *, + operations and no
> precedence among the operators, identify the set of parenthesis which
> maximize the results for E.
>
> --
> 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]<algogeeks%[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.

Reply via email to