What all blocks does Block 3 & Block 5 dominate in the Flow graph for the TAC…

2025

What all blocks does Block 3 & Block 5 dominate in the Flow graph for the TAC given in the passage?

  1. A.

    Block 3 : 3  ; Block 5 : 5

  2. B.

    Block 3 : 3, 4, 5, 6 ; Block 5 : 5, 6

  3. C.

    Block 3 : 3, 7  ; Block 5 : 5, 7

  4. D.

    Block 3 : 3, 4, 7 ; Block 5 : 5, 6, 7

Attempted by 51 students.

Show answer & explanation

Correct answer: A

Dominance rule:
A block X dominates block Y if every possible path from the entry block to Y must pass through X.

Flow-graph understanding (brief)

  • Block 3 contains the condition if i > j goto 105 and forms the loop control point.

  • From Block 3, control can go:

    • to Block 5 (via 105), or

    • directly to Block 7 (via 111).

Because of this:

  • Blocks 5, 6, 7 can be reached without necessarily passing again through Block 3.

  • So Block 3 does not dominate any other block except itself.

  • Block 5 contains the condition if num > b goto 107.

  • From Block 5, control can:

    • go to Block 6 (107), or

    • go directly to Block 7 (111).

Since blocks 6 and 7 can be reached via paths not passing through Block 5,
Block 5 only dominates itself.

Final Answer

  • Block 3 dominates: 3

  • Block 5 dominates: 5

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor