retagged by
261 views

1 Answer

Best answer
0 votes
0 votes

In linux regex, when "?" is used then it will be the case that preceding character matches 0 or 1 times.

when "*" is used then preceding character matches 0 or more times.

Hence for a? = a will be appear 0 or 1 time only.

b*? = b will be appear 0 or more times.

Hence a?b*? = epsilon, b,bb,bbb,.... , ab,abb,abbb...

Hence answer is option C.

selected by
Answer:

Related questions

0 votes
0 votes
0 answers
2
navya n asked Sep 3, 2018
592 views
Consider this regular expression: r = (a*b)* + (b*a)*This is equivalent to(a) (a + b)*(b) (a + b)* · (ab)+ + (a + b)* (ba)+(c) (a + b)*a + (a + b)* b(d) None of above
0 votes
0 votes
3 answers
4
targate2018 asked Dec 5, 2017
619 views
m=1;for i=1 to n do begin m=m*3; for j=1 to m do {Something which is O(1)}What is the complexity of above algorithm?1. O(n*m3)2. O(n3)3. O(3n)...