• edited by
2,262 views
1 1 vote
Consider the following three address code:

T1= a+b

T2= c+d

T3=a-b

T4= T1+T3

T5= T2+T1

T6 = T5+T4

T7 = c + T6

Number of nodes and edges in DAG of the above code?

If we'll do simplification , then T4 would be T4 = a+b+a-b => a+a , after this simplification T3 is not used anywhere in the program, so it can be eliminated or we'll include it in DAG??

1 Answer

0 0 votes

The answer will be minimum 10 nodes and 12 edges. The 3-address code order has to be maintained while elimination terms. 

Position:
Show:

Related questions

1 1 vote
1 1 answer
435
435 views
Shubham Sharma 2 asked Sep 10, 2025
435 views
Consider the following Three Address code sample for solving the questions:$\begin{array}{lll} 100 &: & t 1=y+2 \\ 101 & : & \text {initial }=x / t 1 \\ 102 & : & \text {...
0 0 votes
1 1 answer
332
332 views
Shubham Sharma 2 asked Sep 10, 2025
332 views
Consider the following Three Address code sample for solving the questions:$\begin{array}{lll} 100 & : & t 1=y+2 \\ 101 & : & \text{initial} = x/t1 \\ 102 & :& \text{limi...