Computer Science EngineeringHardISRO SC

Using Sethi-Ullman labelling (a left leaf needs 1 register, a right leaf operand can be a memory operand and needs 0), the minimum number of registers to evaluate (b * (((h * e) - (d * c)) * a)) without spilling is

  1. A. 3
  2. B. 1
  3. C. 4
  4. D. 2

Correct answer: D. 2

Label each node: leaf-left 1, leaf-right 0, internal = max(l,r) if different else l+1. Root label = 2.

More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions

Exams that ask this topic