Skip to content
Related Articles

Related Articles

GATE | Quiz for Sudo GATE 2021 | Question 44

View Discussion
Improve Article
Save Article
  • Last Updated : 18 Dec, 2020
View Discussion
Improve Article
Save Article

A regular expression is ambiguous when there exists a string which can be constructed in two different ways from the regular expression. Which of the following regular expression(s) are ambiguous?

Note – This question is multiple select questions (MSQ).
(A) a((ab)*cd)* ∪ a(ababcb*)*a*
(B) aab*(ab)* ∪ ab* ∪ a*bba*
(C) aaba* ∪ aaaba ∪ aabba* ∪ a
(D) None of these

Answer: (A) (B)

Explanation: (A) Ambiguous. For instance, the string a can be constructed by using a((ab)*cd)* or a(ababcb*)*a*.
(B) Ambiguous. The string abb can be constructed either by ab* or a*bba*.
(C) Unambiguous.

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!