edited by
341 views
–2 votes
–2 votes

Kindly explain this problem. Thank you in advance. 

edited by

1 Answer

1 votes
1 votes
Yes given solution is correct

Prefix for 'baba' starts from beginning so $\epsilon$ , 1 length = b, 2 length = ba , 3 length = bab,4 length = baba

postfix for 'baba' is counting from end but you have  put each alphabet in stack and write it as it pop. For eg. string baba when put in stack for postfix, stack={a,b,a,b} and on pop, output is 'baba' (This is only for postfix evaluation).

so counting from end we got  $\epsilon$, 1 length = a , 2 length = ba[stack={a,b}], 3 length = aba, 4 length = baba

thus intersection is {ba, baba, $\epsilon$}

Related questions

0 votes
0 votes
1 answer
1
jaswinder asked Oct 12, 2023
213 views
HELLO SIR , SIR I HAVE LEFT WITH TOC, CD , DM AND CN AND I THOUGHT , I SHOULD LEAVE ANY TWO OF THESE SO THAT I CAN FOCUS ON REVISION PROPERLY… SO , I WANT TO KNOW THAT ...
2 votes
2 votes
1 answer
4