in Compiler Design recategorized by
4,347 views
0 votes
0 votes

Identify the correct nodes and edges in the given intermediate code

  1. $i=1$
  2. $t1=5*i$
  3. $t2=4*t1$
  4. $t3=t2$
  5. $a[t3]=0$
  6. $i=i+1$
  7. if $i<15$ goto(2)
  1. $33$
  2. $44$
  3. $43$
  4. $34$
in Compiler Design recategorized by
by
4.3k views

1 Answer

0 votes
0 votes

 

so 4 NODES & 4 EDGES.

OPTION B is correct

 

refer:-> https://en.wikipedia.org/wiki/Control_flow_graph

 

edited by

2 Comments

Dude, this is so incorrect.

The nodes are:-

  1. Start
  2. 1
  3. 2 to 7
  4. End

 

And edges will be 4.

An edge from Start to 1.

An edge from 1 to 2-7.

A self-loop on 2-7

An edge from 2-7 to end.

 

Option B is the answer.

https://gateoverflow.in/8139/gate2015-2-29

5
5
Thankyou for pointing out the error.
0
0
Answer: