logo

Question detail

A syntax diagram has a path from Start to End that passes through "A" and then an optional section containing "B". Which set contains all the strings accepted by this diagram?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Context-free languages

Exam-style question

Try this first

A syntax diagram has a path from Start to End that passes through "A" and then an optional section containing "B". Which set contains all the strings accepted by this diagram?.

  1. A.A and AB
  2. B.B and BA
  3. C.A only
  4. D.AB only

Model answer

What a good answer should say

  • A and AB

Explanation

Why this works

The diagram requires "A" and allows the section containing "B" to be skipped or followed. The accepted strings are therefore "A" and "AB".

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.