365 views

1 Answer

1 votes
1 votes
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 ).

Related questions

3 votes
3 votes
2 answers
1
2 votes
2 votes
1 answer
2
Souvik33 asked Nov 23, 2022
322 views
If L and $L^{c}$ both are CFL, the L must be DCFL a. TRUE b.FALSE
1 votes
1 votes
2 answers
3
atulcse asked Jan 21, 2022
717 views
Is the following language a DCFL? Please explain your reasoning.
0 votes
0 votes
1 answer
4
atulcse asked Jan 21, 2022
873 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?