The following Grammar is — S → aSb | bac | aB S → aSb | b S → aabb | ab bca →…
2022
The following Grammar is — S → aSb | bac | aB S → aSb | b S → aabb | ab bca → bdb | b
- A.
Type-0 (Unrestricted Grammar)
- B.
Regular
- C.
Context sensitive
- D.
LR(k)
Attempted by 78 students.
Show answer & explanation
Correct answer: A
Not Regular → because rules like
S → aSbare not allowed in regular grammarNot Context-Free → LHS must be a single non-terminal (violated by
bca → ...)Not Context-Sensitive → length decreases in
bca → b
✔️ Therefore, the grammar belongs to Type-0 (Unrestricted Grammar)