GATE Computer ScienceVery hardGATE CS

Which of the following languages can be accepted by a deterministic pushdown automaton by EMPTY STACK (the stack is empty at the end of the input; no final states)? I. { aⁿbⁿ : n ≥ 0 } II. { aⁿbⁿ : n ≥ 1 } III. a* IV. { w c wᴿ : w ∈ {a, b}* }

  1. A. IV only
  2. B. II and IV only
  3. C. II, III and IV only
  4. D. I and II only

Correct answer: B. II and IV only

A language accepted by a DPDA by empty stack must be prefix-free: once the stack is empty the machine has halted. I contains ε, which is a prefix of every other member; III has a, aa, aaa, ... as prefixes of each other. II and IV are prefix-free deterministic languages.

More Theory of Computation questions

Exams that ask this topic