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

Discussion

Sethi Ullman numbering labels each node of an expression tree with

  • A.the minimum number of registers needed to evaluate that subtree
  • B.the number of instructions that the subtree will finally produce
  • C.the depth of the node below the root of the tree
  • D.the cost in cycles of the operation at that node

Answer: A

Correct answer: the minimum number of registers needed to evaluate that subtree

The label of a node follows from its children: equal labels need one more register than either, unequal labels need the larger of the two. Evaluating the more demanding subtree first then minimises the registers required, which is what the numbering is for.

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

Post your comment

Please log in or register to post a comment.