retagged by
602 views
7 votes
7 votes
Consider the following $3-$address code.

$t_1=t+e$

$t_2=g+a$

$t_3=t_1+t_2$

$t_4=t_2+t_2$

$t_5=t_4+t_3$

There are five temporary variables in above code. The minimum number of temporary variables that can be used in the equivalent optimised $3-$address code of above code are ______________.

Can anyone Confirm How many temporary variables required here.? I got 3 .
retagged by

1 Answer

Best answer
2 votes
2 votes

Two temporary Variables are required
t1 = t+e

t2 = g+a

t1 = t1*t2

t2 = t2+t2

t1=t1+t2

Correct me if I am wrong.

selected by
Answer:

Related questions

1 votes
1 votes
0 answers
1
Hemant Parihar asked Jan 19, 2018
1,178 views
Consider the following code segment:c = b + ae = c - af = c * eh = c + ai = h + fThe minimum number of temporary variable required to convert the above code segment to s...
0 votes
0 votes
1 answer
2
minal asked Jan 22, 2019
937 views
# of temporary variable required to create 3 address code in static single assignment form for the expression P+Q*R-S/(Q*R).