So I've found this PDA to accept palindromes in the language {0,1}*.
However, I'm failing to understand how it could could accept '1' or '0'.
In B
it can read a 1 or 0 and push the same symbol to the stack and then go to C
. However once it's in C
, it has nowhere to go as to reach $ in the stack another symbol needs to be read.
Can someone explain how it works?
I'm thinking that in order to accept a single symbol, we would need a transition from B
to D
=> 1,$->ε | 0,$->ε
.
Would I be correct?
Thanks :)