GATE | GATE-CS-2014-(Set-3) | Question 44
Consider the basic block given below.
a = b + c c = a + d d = b + c e = d - b a = e + b
The minimum number of nodes and edges present in the DAG representation of the above basic block respectively are
(A) 6 and 6
(B) 8 and 10
(C) 9 and 12
(D) 4 and 4
Explanation: Simplifying the given equations :
d = b + c (given) e = d – b (given)
=> d = b + c and e = c
e = d – b (given) a = e + b (given)
=> a = d
Thus, the given DAG has 6 nodes and 6 edges.
Please comment below if you find anything wrong in the above post.