GATE Computer ScienceHardGATE CSE · NIELIT
The interference graph of six variables v0–v5 has edges v0 with each of v1–v5, plus the cycle v1–v2–v3–v4–v5–v1. What is the minimum number of registers needed for a conflict-free allocation (graph colouring)?
- A. 4
- B. 3
- C. 5
- D. 6
Correct answer: A. 4
The hub v0 needs its own colour, and the odd 5-cycle needs 3 more colours, so the chromatic number is 4.
More Compiler Design questions
- Using E → E + T | T; T → T F | F; F → ( E ) | id, how many nodes (terminal leaves included) does the parse tree of id + id id id + id have?
- After local common-subexpression elimination, algebraic simplification (x + 0, x 1), copy propagation and dead-code elimination, how many…
- Left factoring is applied to A → a b c | a b d | a e | f, and the shared prefixes are factored as far as possible, with new non-terminals…
- How many cells of the LL(1) parsing table of E → T E′; E′ → + T E′ | ε; T → F T′; T′ → F T′ | ε; F → ( E ) | id contain a production?…
- How many states does the canonical LR(0) collection of the augmented grammar S′ → S; S → a S b | a b have, and how many of them have a…
- For E → E + T | T; T → T F | F; F → ( E ) | id, how many LR(0) states have a conflict that is resolved by the SLR(1) FOLLOW-set check…