1 votes 1 votes Q). Consider the following directed acyclic graph (DAG): The expression represented by above DAG is: (A) $a+a+(a+a+a)$ (B) $a+a+(a+a+a+(a+a+a+a))$ (C) $a+a+(a+a+a+(a+a+a))$ (D) None Compiler Design compiler-design code-optimization directed-acyclic-graph + – Mojo-Jojo asked Jan 29, 2016 • edited Jun 18, 2022 by Lakshman Bhaiya Mojo-Jojo 3.4k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
5 votes 5 votes In this question better u go bottom - up so here 1. (a+a) 2. ((a+a)+a) 3. (((a+a) +a) + a) so here option D is correct Hradesh patel answered Jan 11, 2017 Hradesh patel comment Share Follow See all 3 Comments See all 3 3 Comments reply Samujjal Das commented Jan 11, 2017 reply Follow Share D right?? Sure na? 0 votes 0 votes Hradesh patel commented Jan 11, 2017 reply Follow Share yes ...option D 0 votes 0 votes Samujjal Das commented Jan 11, 2017 reply Follow Share Okay bro. I was not expecting errors from Virtual Gate. Thats why I am double checking. 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes operator + is left associative.the expression has to be left asssociative.but the resulting grammar may be left of right recursive. and answer has 4 a's in the expression viv696 answered Jan 29, 2016 viv696 comment Share Follow See all 4 Comments See all 4 4 Comments reply Sumit1311 commented Jan 29, 2016 reply Follow Share So D is the answer 0 votes 0 votes viv696 commented Jan 29, 2016 reply Follow Share yup 1 votes 1 votes Abhijit Borah commented Jan 29, 2016 reply Follow Share Is it ((a+a)+a)+a) ...the answer ? 1 votes 1 votes Jason_Roy commented Feb 5, 2017 reply Follow Share Abhijit Borah I think, you are right. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes Answer is D. jiitalok answered Feb 3, 2016 jiitalok comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes The right answaer of this question is option B Ayush Verma answered May 1, 2017 Ayush Verma comment Share Follow See all 0 reply Please log in or register to add a comment.