Machine-translated by Google. Questions are authored in English.
Top

Discussion

A three address program of 20 instructions has 4 leaders. How many basic blocks does it contain?

  • A.4
  • B.5
  • C.16
  • D.20

Answer: A

A leader is the first instruction of a basic block, and every block has exactly one leader, so the two counts are equal: \[ \text{blocks} = \text{leaders} = 4 \] The 20 instructions are partitioned among those four blocks, with none left over and none belonging to two blocks at once. The instruction count constrains the average block size, \( 20/4 = 5 \), but not the number of blocks.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.