Computer Science EngineeringVery hard
Which of the following languages requires a nondeterministic pushdown automaton (cannot be accepted by a deterministic PDA)?
- A. {a^n b^n | n >= 0}
- B. {w w^R | w in {a,b}*}
- C. {w c w^R | w in {a,b}*}
- D. {a^n b^m | n, m >= 0}
Correct answer: B. {w w^R | w in {a,b}*}
Without a middle marker a PDA must guess where the string midpoint lies, which needs nondeterminism.
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
- If both a language L and its complement are recursively enumerable, then L is
- Left recursion must be eliminated from a grammar before it can be used with
- Which parser accepts the largest class of grammars among the following?
- For a given grammar, an LALR(1) parser has the same number of states as which other parser?
- How many nodes does the DAG for the expression a + a(b-c) + (b-c)d contain (common subexpressions shared)?
- Type checking of expressions is performed during which phase of a compiler?