486 views
1 1 vote

Consider the following basic block:

$$
\begin{aligned}
& w=x+y \\
& z=w * 2 \\
& x=y+z \\
& w=x-y
\end{aligned}
$$


The minimum number of NODES and the total number of OPERATOR LABELS required to represent the operations in the DAG of the above basic block, respectively, are:

  1. $7$ and $3$
     
  2. $9$ and $7$
     
  3. $6$ and $3$
     
  4. $8$ and $4$

2 Answers

0 0 votes
Initial leaf nodes: $x, y, 2$

New nodes created: $w 0, z 0, x 0, w 1$

Total no of nodes $=7$

Total no of operator labels $=3$

A is correct
1 flag:
✌ Edit necessary (Prince_Garg “I think 6 and 3 is the perfect ans for this”)
Answer:
Position:
Show:

Related questions

1 1 vote
2 2 answers
287
287 views
GO Classes asked Dec 19, 2025
287 views
Consider the following basic block:$$\begin{aligned}& \mathrm{t} 1=\mathrm{a}+\mathrm{b} \\& \mathrm{t} 2=\mathrm{c}+\mathrm{d} \\& \mathrm{t} 3=\mathrm{t} 1 * 2 \\& \mat...
2 2 votes
3 3 answers
362
362 views
GO Classes asked Dec 19, 2025
362 views
A lexical analyzer uses the following regular expressions (REs) to recognize four tokens, $T_1, T_2$, $T_3$, and $T_4$, over the alphabet $\Sigma=\{a, b, c\}$.$T_1:(a \mi...
2 2 votes
3 3 answers
328
328 views
GO Classes asked Dec 19, 2025
328 views
Consider the following C code snippet:float val = 2.0; /* Check Condition */ if (val <= MAX) { val /= 2; }What is the total number of tokens identified by the lexical...
1 1 vote
4 4 answers
532
532 views
GO Classes asked Dec 19, 2025
532 views
Consider the following canonical set of LR(0) items:$$I_5=\left\{\begin{array}{l}R \rightarrow x \cdot P y \\R \rightarrow x P \\P \rightarrow y\end{array}\right.$$Which ...