624 views

1 Answer

1 1 vote
Approach :

Push (a) :“P” times

Push (b): “P” times

we now have “2*P” element in stack ,Now Remove 2 element  for one “a” .

Dear @jugnu1337,

In your approach you completely ignore “b” ,which can lead to some problem like this :

string: aabaa  (this string should not be accepted but it will be accepted by  your logic ).
Position:
Show:

Related questions

3 3 votes
2 2 answers
1.1k
1.1k views
Jiten008 asked Oct 24, 2023
1,117 views
Can anyone explain $\overline{ww}$ is $CFL$ or $CSL$ And if $CFL$ can you write the equivalent $CFG$ for this ?
2 2 votes
1 1 answer
638
638 views
Souvik33 asked Nov 23, 2022
638 views
If L and $L^{c}$ both are CFL, the L must be DCFL a. TRUE b.FALSE
1 1 vote
2 2 answers
2.0k
2.0k views
atulcse asked Jan 21, 2022
1,950 views
Is the following language a DCFL? Please explain your reasoning.
0 0 votes
2 2 answers
2.4k
2.4k views
atulcse asked Jan 21, 2022
2,351 views
Given a CFG and a string, what is the relation between the number of leftmost derivations, the number of rightmost derivations and the number of parse trees?