GATE CS 2021, set 1 · Question 15 · Compiler Design · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Consider the following statements.
S₁ : Every SLR(1) grammar is unambiguous but there are certain unambiguous grammars that are not SLR(1).
S₂ : For any context-free grammar, there is a parser that takes at most O(n³) time to parse a string of length n.
Which one of the following options is correct?

  1. (A) S₁ is true and S₂ is false
  2. (B) S₁ is false and S₂ is true
  3. (C) S₁ is true and S₂ is true
  4. (D) S₁ is false and S₂ is false
Answer

Answer (C)

Answer from the official GATE CS 2021 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes