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
- A. 3
- B. 1
- C. 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.
Practise more Theory of Computation, Compilers & Digital Logic (ISRO CS) questionsTheory of Computation, Compilers & Digital Logic (ISRO CS): notes and key points
More Theory of Computation, Compilers & Digital Logic (ISRO CS) questions
- In register allocation by graph colouring, the interference graph has nodes v0..v7 and edges v0-v1, v0-v3, v0-v4, v0-v5, v1-v2, v1-v3…
- A flow graph has blocks B1: use{a,d} def{b}; B2: use{a} def{b,d}; B3: use{d} def{a,b,c}; B4: use{a} def{}. Edges: B1->B2, B2->B3, B2->B4…
- Build the DAG for ((((c + a) + (b - a)) ((a b) + (b + a))) + (((a b) + (b + a)) + ((a b) + (b + a)))) using value numbering, treating +…
- A scanner uses maximal munch with identifiers [a-z][a-z0-9], decimals digits(.digits)?, and operators/punctuators including <<=, <<, <=…
- Nested procedures use static (access) links. A procedure at nesting depth 4 references a local variable declared in an enclosing procedure…
- Nested procedures use static (access) links. A procedure at nesting depth 3 references a local variable declared in an enclosing procedure…