Question 71Asked in Bihar STET Paper 2 Computer Science (Class 11-12), 12 Sep 2023, Shift 2The context free grammar S → SS | 0S1 | 1S0 | ɛ generates
- AEqual number of 0’s and 1’s
- BUnequal number of 0’s and 1’s
- CAny number of 0’s followed by any number of 1’s
- DNone of these
Show answerHide answer
Correct answer: (A) Equal number of 0’s and 1’s
Explanation
Every rule adds one 0 and one 1 together (0S1, 1S0) or concatenates such strings (SS), so all generated strings have equal numbers of 0s and 1s.