The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+1 vote
242 views
A directed acyclic graph represents one form of intermediate repsentation .The number of non terminal nodes in DAG of a=(b+c)*(b+c)

a)2

b)3

c)4

d)5
asked in Compiler Design by Active (1.7k points) | 242 views
0
is answer  3??
0
Yes answer is 3.Plz explain

1 Answer

+8 votes
Best answer

This is what I get,

The above diagram clearly shows that there are three Non-terminal nodes present the DAG. Hence answer is 3.

answered by Boss (35.5k points)
selected by
0
its answer is 3 only
+1
a is not a internal node.it is a leaf node.i got the same graph.hence 3
+2
@Akriti Sood great :) :)
+2
@Neha Singh: Actually I misread the question. This has asked the number of non-terminal nodes, and i was counting all nodes. Now I have edited. Have a look. :) enjoy.
0
...:)


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

39,658 questions
46,733 answers
140,423 comments
58,145 users