Redirected
edited by
3,301 views
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

edited by

4 Answers

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
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

0 votes
0 votes
The right answaer of this question is option B
Answer:

Related questions

2 votes
2 votes
1 answer
1
0 votes
0 votes
1 answer
2
phprashanthans asked Dec 3, 2017
849 views
What will be the DAG representation of a=b+c , b= b+c
6 votes
6 votes
1 answer
3
set2018 asked Sep 28, 2017
3,048 views
A) 2B)3C) 4D) 5
0 votes
0 votes
1 answer
4
thor asked Jan 22, 2017
638 views
How does answer change when it is in SSA form? does answer remains 4 or 5