how can once evaluate a+b, when a and b are just variables.. Its not
necessary that the expression contains all the constants.
On Wed, Oct 13, 2010 at 10:07 AM, Shiyam code_for_life <
mailshyamh...@gmail.com> wrote:
> For every pair of braces,
> Evaluate the expression within the outer braces of
For every pair of braces,
Evaluate the expression within the outer braces of current braces
under consideration
(1)With current braces
(2)Without current braces
If both are the same, then you can drop the current braces that its
redundant.
P.S for outer most braces, evaluate the entire expression
For every pair of braces,
Evaluate the expression within the outer braces of current braces
under consideration
(1)With current braces
(2)Without current braces
If both are the same, then you can drop the current braces that its
redundant.
P.S for outer most braces, evaluate the entire expression
@Dave
I agree, I missed those use cases. let me get back with the revised version.
-Regards
Amit Agarwal
blog.amitagrwal.com
On Fri, Oct 8, 2010 at 9:48 PM, Dave wrote:
> @Amit: There is more to it than that, involving operators of equal
> precedence. Consider a-(b+c) versus (a-b)+c or a+(b-c
We worked on this one before. Please see
http://groups.google.com/group/algogeeks/msg/e8fb40ab2ba0ecc0
On Oct 8, 2:12 am, snehal jain wrote:
> write a program to remove redundantt parenthesis from an expression
> eg
> input ((a+b))
>
> output a+b
>
> input a+(b*c)
>
> output a+b*c
>
> input
@Amit: There is more to it than that, involving operators of equal
precedence. Consider a-(b+c) versus (a-b)+c or a+(b-c), or a/(b*c)
versus (a/b)*c or (a*b)/c. In the first case of each set, removing the
parentheses is wrong, but in the other cases of each, the parentheses
are redundant and can be