Random commentary about Machine Learning, BigData, Spark, Deep Learning, C++, STL, Boost, Perl, Python, Algorithms, Problem Solving and Web Search
Saturday, December 18, 2010
Maximize and expression with no parenthesis
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.
This one is straightforward.. unless you allow a number N to be negative. Then you need to make two independent tables and construct them simultaneously since a negative multiplier makes a minimum value suddenly a potential maximum.
This one is straightforward.. unless you allow a number N to be negative. Then you need to make two independent tables and construct them simultaneously since a negative multiplier makes a minimum value suddenly a potential maximum.
ReplyDelete