+1 vote
100 views

The minimum number of temporary variables to convert it into SSA is _________.
a + b × c + d – e – a + b × c
Assume order of precedence from highest to lowest as: ×, + and –. Consider associativity for + and × are not important but – is left associative.

My ans : 5

| 100 views
0
Is it 6 ??
0
i'm also getting 6?
0
t1=b*c;

t2=a+t1;

t3=t2+d;

t4=t3-e;

t5=t4-t2;

im getting 5 ...
0
Look at that line "-" is left associative so you have to do d-e and then there result -a and then remaining things.
0

yeah same as  Anjan

0

I think left associative mean leftmost - is evaluated first.

but not as "so you have to do d-e and then there result -a"

please correct me if i'm wrong Ashwin Kulkarni

+1
I am getting 5.

$t1 = b*c$

$t2 = a + t1$

$t3 = t2 + d$

$t4 = t3-e$

$t5 = t4 - t2$

Paranthesization of the expression is:- $((((a+(b*c)+d)-e)-(a+(b*c)))$

Precedence of Operator is * > + > -