retagged by
400 views

1 Answer

Best answer
1 votes
1 votes
First S --> rAd is chosen

then A-->y is chosen which is false So backtrack to A and verify other options (1st backtrack).

then A-->z is chosen which is false So backtrack to A and verify other options (2nd backtrack).

Since all options of A are verified  now backtrack to S and choose S-->rB. (3rd backtrack )

then B-->zzd is chosen which is false So backtrack to B and verify other options (4th backtrack).

then B--ddz is chosen which we want.

So total 4 backtracks I think.
selected by
Answer:

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
4 votes
4 votes
1 answer
3
mohitbawankar asked Jan 10, 2018
1,626 views
Consider the given below grammarS→ cAdA→ bA | aA | bIf a recursive descent parser is used for string “cbababd” then number of back trackin worst case is:
1 votes
1 votes
1 answer
4