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

Discussion

An expression tree contains 5 binary operators. Translating it with one operation per three address instruction produces how many instructions?

  • A.6
  • B.4
  • C.10
  • D.5

Answer: D

Each operator becomes one instruction, so five are emitted. The number of temporaries introduced is also five, one holding the result of each operation. Later optimisation may eliminate several of them by reusing registers.

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

Post your comment

Please log in or register to post a comment.