Open In App

GATE | GATE-CS-2014-(Set-3) | Question 44

Like Article
Like
Save
Share
Report

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

 
2014-set3-44

 
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
Previous
Next
Share your thoughts in the comments
Similar Reads