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
Answer: (A)
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.
Quiz of this Question
Last Updated :
17 Sep, 2021
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...